@lbrlabs/pulumi-grafana
Version:
A Pulumi package for creating and managing grafana.
113 lines (112 loc) • 5.75 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Sets up Synthetic Monitoring on a Grafana cloud stack and generates a token.
* Once a Grafana Cloud stack is created, a user can either use this resource or go into the UI to install synthetic monitoring.
* This resource cannot be imported but it can be used on an existing Synthetic Monitoring installation without issues.
*
* **Note that this resource must be used on a provider configured with Grafana Cloud credentials.**
*
* * [Official documentation](https://grafana.com/docs/grafana-cloud/monitor-public-endpoints/installation/)
* * [API documentation](https://github.com/grafana/synthetic-monitoring-api-go-client/blob/main/docs/API.md#apiv1registerinstall)
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@lbrlabs/pulumi-grafana";
*
* const smStackCloudStack = new grafana.CloudStack("smStackCloudStack", {
* slug: "<stack-slug>",
* regionSlug: "us",
* });
* const metricsPublish = new grafana.CloudApiKey("metricsPublish", {
* role: "MetricsPublisher",
* cloudOrgSlug: "<org-slug>",
* });
* const smStackSyntheticMonitoringInstallation = new grafana.SyntheticMonitoringInstallation("smStackSyntheticMonitoringInstallation", {stackId: smStackCloudStack.id});
* // Create a new provider instance to interact with Synthetic Monitoring
* const sm = new grafana.Provider("sm", {
* smAccessToken: smStackSyntheticMonitoringInstallation.smAccessToken,
* smUrl: smStackSyntheticMonitoringInstallation.stackSmApiUrl,
* });
* ```
*/
export declare class SyntheticMonitoringInstallation extends pulumi.CustomResource {
/**
* Get an existing SyntheticMonitoringInstallation resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: SyntheticMonitoringInstallationState, opts?: pulumi.CustomResourceOptions): SyntheticMonitoringInstallation;
/**
* Returns true if the given object is an instance of SyntheticMonitoringInstallation. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is SyntheticMonitoringInstallation;
/**
* The Cloud API Key with the `MetricsPublisher` role used to publish metrics to the SM API
*/
readonly metricsPublisherKey: pulumi.Output<string>;
/**
* Generated token to access the SM API.
*/
readonly smAccessToken: pulumi.Output<string>;
/**
* The ID or slug of the stack to install SM on.
*/
readonly stackId: pulumi.Output<string>;
/**
* The URL of the SM API to install SM on. This depends on the stack region, find the list of API URLs here: https://grafana.com/docs/grafana-cloud/monitor-public-endpoints/private-probes/#probe-api-server-url. A static mapping exists in the provider but it may not contain all the regions. If it does contain the stack's region, this field is computed automatically and readable.
*/
readonly stackSmApiUrl: pulumi.Output<string>;
/**
* Create a SyntheticMonitoringInstallation resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: SyntheticMonitoringInstallationArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering SyntheticMonitoringInstallation resources.
*/
export interface SyntheticMonitoringInstallationState {
/**
* The Cloud API Key with the `MetricsPublisher` role used to publish metrics to the SM API
*/
metricsPublisherKey?: pulumi.Input<string>;
/**
* Generated token to access the SM API.
*/
smAccessToken?: pulumi.Input<string>;
/**
* The ID or slug of the stack to install SM on.
*/
stackId?: pulumi.Input<string>;
/**
* The URL of the SM API to install SM on. This depends on the stack region, find the list of API URLs here: https://grafana.com/docs/grafana-cloud/monitor-public-endpoints/private-probes/#probe-api-server-url. A static mapping exists in the provider but it may not contain all the regions. If it does contain the stack's region, this field is computed automatically and readable.
*/
stackSmApiUrl?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a SyntheticMonitoringInstallation resource.
*/
export interface SyntheticMonitoringInstallationArgs {
/**
* The Cloud API Key with the `MetricsPublisher` role used to publish metrics to the SM API
*/
metricsPublisherKey: pulumi.Input<string>;
/**
* The ID or slug of the stack to install SM on.
*/
stackId: pulumi.Input<string>;
/**
* The URL of the SM API to install SM on. This depends on the stack region, find the list of API URLs here: https://grafana.com/docs/grafana-cloud/monitor-public-endpoints/private-probes/#probe-api-server-url. A static mapping exists in the provider but it may not contain all the regions. If it does contain the stack's region, this field is computed automatically and readable.
*/
stackSmApiUrl?: pulumi.Input<string>;
}