@lbrlabs/pulumi-grafana
Version:
A Pulumi package for creating and managing grafana.
157 lines (156 loc) • 4.92 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Get details about a Grafana Datasource querying by either name, uid or ID
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@lbrlabs/pulumi-grafana";
* import * as grafana from "@pulumi/grafana";
*
* const prometheus = new grafana.DataSource("prometheus", {
* type: "prometheus",
* uid: "prometheus-ds-test-uid",
* url: "https://my-instance.com",
* basicAuthEnabled: true,
* basicAuthUsername: "username",
* jsonDataEncoded: JSON.stringify({
* httpMethod: "POST",
* prometheusType: "Mimir",
* prometheusVersion: "2.4.0",
* }),
* secureJsonDataEncoded: JSON.stringify({
* basicAuthPassword: "password",
* }),
* });
* const fromName = grafana.getDataSourceOutput({
* name: prometheus.name,
* });
* const fromId = grafana.getDataSourceOutput({
* id: prometheus.id,
* });
* const fromUid = grafana.getDataSourceOutput({
* uid: prometheus.uid,
* });
* ```
*/
export declare function getDataSource(args?: GetDataSourceArgs, opts?: pulumi.InvokeOptions): Promise<GetDataSourceResult>;
/**
* A collection of arguments for invoking getDataSource.
*/
export interface GetDataSourceArgs {
/**
* The ID of this resource.
*/
id?: string;
name?: string;
/**
* The Organization ID. If not set, the Org ID defined in the provider block will be used.
*/
orgId?: string;
uid?: string;
}
/**
* A collection of values returned by getDataSource.
*/
export interface GetDataSourceResult {
/**
* The method by which Grafana will access the data source: `proxy` or `direct`.
*/
readonly accessMode: string;
/**
* Whether to enable basic auth for the data source.
*/
readonly basicAuthEnabled: boolean;
/**
* Basic auth username.
*/
readonly basicAuthUsername: string;
/**
* (Required by some data source types) The name of the database to use on the selected data source server.
*/
readonly databaseName: string;
/**
* The ID of this resource.
*/
readonly id: string;
/**
* Whether to set the data source as default. This should only be `true` to a single data source.
*/
readonly isDefault: boolean;
/**
* Serialized JSON string containing the json data. This attribute can be used to pass configuration options to the data source. To figure out what options a datasource has available, see its docs or inspect the network data when saving it from the Grafana UI. Note that keys in this map are usually camelCased.
*/
readonly jsonDataEncoded: string;
readonly name: string;
/**
* The Organization ID. If not set, the Org ID defined in the provider block will be used.
*/
readonly orgId?: string;
/**
* The data source type. Must be one of the supported data source keywords.
*/
readonly type: string;
readonly uid: string;
/**
* The URL for the data source. The type of URL required varies depending on the chosen data source type.
*/
readonly url: string;
/**
* (Required by some data source types) The username to use to authenticate to the data source.
*/
readonly username: string;
}
/**
* Get details about a Grafana Datasource querying by either name, uid or ID
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@lbrlabs/pulumi-grafana";
* import * as grafana from "@pulumi/grafana";
*
* const prometheus = new grafana.DataSource("prometheus", {
* type: "prometheus",
* uid: "prometheus-ds-test-uid",
* url: "https://my-instance.com",
* basicAuthEnabled: true,
* basicAuthUsername: "username",
* jsonDataEncoded: JSON.stringify({
* httpMethod: "POST",
* prometheusType: "Mimir",
* prometheusVersion: "2.4.0",
* }),
* secureJsonDataEncoded: JSON.stringify({
* basicAuthPassword: "password",
* }),
* });
* const fromName = grafana.getDataSourceOutput({
* name: prometheus.name,
* });
* const fromId = grafana.getDataSourceOutput({
* id: prometheus.id,
* });
* const fromUid = grafana.getDataSourceOutput({
* uid: prometheus.uid,
* });
* ```
*/
export declare function getDataSourceOutput(args?: GetDataSourceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output<GetDataSourceResult>;
/**
* A collection of arguments for invoking getDataSource.
*/
export interface GetDataSourceOutputArgs {
/**
* The ID of this resource.
*/
id?: pulumi.Input<string>;
name?: pulumi.Input<string>;
/**
* The Organization ID. If not set, the Org ID defined in the provider block will be used.
*/
orgId?: pulumi.Input<string>;
uid?: pulumi.Input<string>;
}