grafana.SyntheticMonitoringInstallation

Explore with Pulumi AI

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.

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Grafana = Lbrlabs.PulumiPackage.Grafana;

return await Deployment.RunAsync(() => 
{
    var smStackCloudStack = new Grafana.CloudStack("smStackCloudStack", new()
    {
        Slug = "<stack-slug>",
        RegionSlug = "us",
    });

    var metricsPublish = new Grafana.CloudApiKey("metricsPublish", new()
    {
        Role = "MetricsPublisher",
        CloudOrgSlug = "<org-slug>",
    });

    var smStackSyntheticMonitoringInstallation = new Grafana.SyntheticMonitoringInstallation("smStackSyntheticMonitoringInstallation", new()
    {
        StackId = smStackCloudStack.Id,
    });

    // Create a new provider instance to interact with Synthetic Monitoring
    var sm = new Grafana.Provider("sm", new()
    {
        SmAccessToken = smStackSyntheticMonitoringInstallation.SmAccessToken,
        SmUrl = smStackSyntheticMonitoringInstallation.StackSmApiUrl,
    });

});
package main

import (
	"github.com/lbrlabs/pulumi-grafana/sdk/go/grafana"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		smStackCloudStack, err := grafana.NewCloudStack(ctx, "smStackCloudStack", &grafana.CloudStackArgs{
			Slug:       pulumi.String("<stack-slug>"),
			RegionSlug: pulumi.String("us"),
		})
		if err != nil {
			return err
		}
		_, err = grafana.NewCloudApiKey(ctx, "metricsPublish", &grafana.CloudApiKeyArgs{
			Role:         pulumi.String("MetricsPublisher"),
			CloudOrgSlug: pulumi.String("<org-slug>"),
		})
		if err != nil {
			return err
		}
		smStackSyntheticMonitoringInstallation, err := grafana.NewSyntheticMonitoringInstallation(ctx, "smStackSyntheticMonitoringInstallation", &grafana.SyntheticMonitoringInstallationArgs{
			StackId: smStackCloudStack.ID(),
		})
		if err != nil {
			return err
		}
		_, err = grafana.NewProvider(ctx, "sm", &grafana.ProviderArgs{
			SmAccessToken: smStackSyntheticMonitoringInstallation.SmAccessToken,
			SmUrl:         smStackSyntheticMonitoringInstallation.StackSmApiUrl,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.grafana.CloudStack;
import com.pulumi.grafana.CloudStackArgs;
import com.pulumi.grafana.CloudApiKey;
import com.pulumi.grafana.CloudApiKeyArgs;
import com.pulumi.grafana.SyntheticMonitoringInstallation;
import com.pulumi.grafana.SyntheticMonitoringInstallationArgs;
import com.pulumi.grafana.Provider;
import com.pulumi.grafana.ProviderArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var smStackCloudStack = new CloudStack("smStackCloudStack", CloudStackArgs.builder()        
            .slug("<stack-slug>")
            .regionSlug("us")
            .build());

        var metricsPublish = new CloudApiKey("metricsPublish", CloudApiKeyArgs.builder()        
            .role("MetricsPublisher")
            .cloudOrgSlug("<org-slug>")
            .build());

        var smStackSyntheticMonitoringInstallation = new SyntheticMonitoringInstallation("smStackSyntheticMonitoringInstallation", SyntheticMonitoringInstallationArgs.builder()        
            .stackId(smStackCloudStack.id())
            .build());

        var sm = new Provider("sm", ProviderArgs.builder()        
            .smAccessToken(smStackSyntheticMonitoringInstallation.smAccessToken())
            .smUrl(smStackSyntheticMonitoringInstallation.stackSmApiUrl())
            .build());

    }
}
import pulumi
import lbrlabs_pulumi_grafana as grafana

sm_stack_cloud_stack = grafana.CloudStack("smStackCloudStack",
    slug="<stack-slug>",
    region_slug="us")
metrics_publish = grafana.CloudApiKey("metricsPublish",
    role="MetricsPublisher",
    cloud_org_slug="<org-slug>")
sm_stack_synthetic_monitoring_installation = grafana.SyntheticMonitoringInstallation("smStackSyntheticMonitoringInstallation", stack_id=sm_stack_cloud_stack.id)
# Create a new provider instance to interact with Synthetic Monitoring
sm = grafana.Provider("sm",
    sm_access_token=sm_stack_synthetic_monitoring_installation.sm_access_token,
    sm_url=sm_stack_synthetic_monitoring_installation.stack_sm_api_url)
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,
});
resources:
  smStackCloudStack:
    type: grafana:CloudStack
    properties:
      slug: <stack-slug>
      regionSlug: us
  metricsPublish:
    type: grafana:CloudApiKey
    properties:
      role: MetricsPublisher
      cloudOrgSlug: <org-slug>
  smStackSyntheticMonitoringInstallation:
    type: grafana:SyntheticMonitoringInstallation
    properties:
      stackId: ${smStackCloudStack.id}
  # Create a new provider instance to interact with Synthetic Monitoring
  sm:
    type: pulumi:providers:grafana
    properties:
      smAccessToken: ${smStackSyntheticMonitoringInstallation.smAccessToken}
      smUrl: ${smStackSyntheticMonitoringInstallation.stackSmApiUrl}

Create SyntheticMonitoringInstallation Resource

new SyntheticMonitoringInstallation(name: string, args: SyntheticMonitoringInstallationArgs, opts?: CustomResourceOptions);
@overload
def SyntheticMonitoringInstallation(resource_name: str,
                                    opts: Optional[ResourceOptions] = None,
                                    logs_instance_id: Optional[int] = None,
                                    metrics_instance_id: Optional[int] = None,
                                    metrics_publisher_key: Optional[str] = None,
                                    stack_id: Optional[str] = None,
                                    stack_sm_api_url: Optional[str] = None)
@overload
def SyntheticMonitoringInstallation(resource_name: str,
                                    args: SyntheticMonitoringInstallationArgs,
                                    opts: Optional[ResourceOptions] = None)
func NewSyntheticMonitoringInstallation(ctx *Context, name string, args SyntheticMonitoringInstallationArgs, opts ...ResourceOption) (*SyntheticMonitoringInstallation, error)
public SyntheticMonitoringInstallation(string name, SyntheticMonitoringInstallationArgs args, CustomResourceOptions? opts = null)
public SyntheticMonitoringInstallation(String name, SyntheticMonitoringInstallationArgs args)
public SyntheticMonitoringInstallation(String name, SyntheticMonitoringInstallationArgs args, CustomResourceOptions options)
type: grafana:SyntheticMonitoringInstallation
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args SyntheticMonitoringInstallationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args SyntheticMonitoringInstallationArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args SyntheticMonitoringInstallationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args SyntheticMonitoringInstallationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args SyntheticMonitoringInstallationArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

SyntheticMonitoringInstallation Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The SyntheticMonitoringInstallation resource accepts the following input properties:

MetricsPublisherKey string

The Cloud API Key with the MetricsPublisher role used to publish metrics to the SM API

StackId string

The ID or slug of the stack to install SM on.

LogsInstanceId int

Deprecated: Not used anymore.

Deprecated:

Not used anymore.

MetricsInstanceId int

Deprecated: Not used anymore.

Deprecated:

Not used anymore.

StackSmApiUrl 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/synthetic-monitoring/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.

MetricsPublisherKey string

The Cloud API Key with the MetricsPublisher role used to publish metrics to the SM API

StackId string

The ID or slug of the stack to install SM on.

LogsInstanceId int

Deprecated: Not used anymore.

Deprecated:

Not used anymore.

MetricsInstanceId int

Deprecated: Not used anymore.

Deprecated:

Not used anymore.

StackSmApiUrl 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/synthetic-monitoring/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.

metricsPublisherKey String

The Cloud API Key with the MetricsPublisher role used to publish metrics to the SM API

stackId String

The ID or slug of the stack to install SM on.

logsInstanceId Integer

Deprecated: Not used anymore.

Deprecated:

Not used anymore.

metricsInstanceId Integer

Deprecated: Not used anymore.

Deprecated:

Not used anymore.

stackSmApiUrl 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/synthetic-monitoring/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.

metricsPublisherKey string

The Cloud API Key with the MetricsPublisher role used to publish metrics to the SM API

stackId string

The ID or slug of the stack to install SM on.

logsInstanceId number

Deprecated: Not used anymore.

Deprecated:

Not used anymore.

metricsInstanceId number

Deprecated: Not used anymore.

Deprecated:

Not used anymore.

stackSmApiUrl 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/synthetic-monitoring/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.

metrics_publisher_key str

The Cloud API Key with the MetricsPublisher role used to publish metrics to the SM API

stack_id str

The ID or slug of the stack to install SM on.

logs_instance_id int

Deprecated: Not used anymore.

Deprecated:

Not used anymore.

metrics_instance_id int

Deprecated: Not used anymore.

Deprecated:

Not used anymore.

stack_sm_api_url str

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/synthetic-monitoring/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.

metricsPublisherKey String

The Cloud API Key with the MetricsPublisher role used to publish metrics to the SM API

stackId String

The ID or slug of the stack to install SM on.

logsInstanceId Number

Deprecated: Not used anymore.

Deprecated:

Not used anymore.

metricsInstanceId Number

Deprecated: Not used anymore.

Deprecated:

Not used anymore.

stackSmApiUrl 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/synthetic-monitoring/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.

Outputs

All input properties are implicitly available as output properties. Additionally, the SyntheticMonitoringInstallation resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

SmAccessToken string

Generated token to access the SM API.

Id string

The provider-assigned unique ID for this managed resource.

SmAccessToken string

Generated token to access the SM API.

id String

The provider-assigned unique ID for this managed resource.

smAccessToken String

Generated token to access the SM API.

id string

The provider-assigned unique ID for this managed resource.

smAccessToken string

Generated token to access the SM API.

id str

The provider-assigned unique ID for this managed resource.

sm_access_token str

Generated token to access the SM API.

id String

The provider-assigned unique ID for this managed resource.

smAccessToken String

Generated token to access the SM API.

Look up Existing SyntheticMonitoringInstallation Resource

Get an existing SyntheticMonitoringInstallation resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: SyntheticMonitoringInstallationState, opts?: CustomResourceOptions): SyntheticMonitoringInstallation
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        logs_instance_id: Optional[int] = None,
        metrics_instance_id: Optional[int] = None,
        metrics_publisher_key: Optional[str] = None,
        sm_access_token: Optional[str] = None,
        stack_id: Optional[str] = None,
        stack_sm_api_url: Optional[str] = None) -> SyntheticMonitoringInstallation
func GetSyntheticMonitoringInstallation(ctx *Context, name string, id IDInput, state *SyntheticMonitoringInstallationState, opts ...ResourceOption) (*SyntheticMonitoringInstallation, error)
public static SyntheticMonitoringInstallation Get(string name, Input<string> id, SyntheticMonitoringInstallationState? state, CustomResourceOptions? opts = null)
public static SyntheticMonitoringInstallation get(String name, Output<String> id, SyntheticMonitoringInstallationState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
LogsInstanceId int

Deprecated: Not used anymore.

Deprecated:

Not used anymore.

MetricsInstanceId int

Deprecated: Not used anymore.

Deprecated:

Not used anymore.

MetricsPublisherKey string

The Cloud API Key with the MetricsPublisher role used to publish metrics to the SM API

SmAccessToken string

Generated token to access the SM API.

StackId string

The ID or slug of the stack to install SM on.

StackSmApiUrl 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/synthetic-monitoring/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.

LogsInstanceId int

Deprecated: Not used anymore.

Deprecated:

Not used anymore.

MetricsInstanceId int

Deprecated: Not used anymore.

Deprecated:

Not used anymore.

MetricsPublisherKey string

The Cloud API Key with the MetricsPublisher role used to publish metrics to the SM API

SmAccessToken string

Generated token to access the SM API.

StackId string

The ID or slug of the stack to install SM on.

StackSmApiUrl 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/synthetic-monitoring/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.

logsInstanceId Integer

Deprecated: Not used anymore.

Deprecated:

Not used anymore.

metricsInstanceId Integer

Deprecated: Not used anymore.

Deprecated:

Not used anymore.

metricsPublisherKey String

The Cloud API Key with the MetricsPublisher role used to publish metrics to the SM API

smAccessToken String

Generated token to access the SM API.

stackId String

The ID or slug of the stack to install SM on.

stackSmApiUrl 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/synthetic-monitoring/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.

logsInstanceId number

Deprecated: Not used anymore.

Deprecated:

Not used anymore.

metricsInstanceId number

Deprecated: Not used anymore.

Deprecated:

Not used anymore.

metricsPublisherKey string

The Cloud API Key with the MetricsPublisher role used to publish metrics to the SM API

smAccessToken string

Generated token to access the SM API.

stackId string

The ID or slug of the stack to install SM on.

stackSmApiUrl 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/synthetic-monitoring/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.

logs_instance_id int

Deprecated: Not used anymore.

Deprecated:

Not used anymore.

metrics_instance_id int

Deprecated: Not used anymore.

Deprecated:

Not used anymore.

metrics_publisher_key str

The Cloud API Key with the MetricsPublisher role used to publish metrics to the SM API

sm_access_token str

Generated token to access the SM API.

stack_id str

The ID or slug of the stack to install SM on.

stack_sm_api_url str

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/synthetic-monitoring/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.

logsInstanceId Number

Deprecated: Not used anymore.

Deprecated:

Not used anymore.

metricsInstanceId Number

Deprecated: Not used anymore.

Deprecated:

Not used anymore.

metricsPublisherKey String

The Cloud API Key with the MetricsPublisher role used to publish metrics to the SM API

smAccessToken String

Generated token to access the SM API.

stackId String

The ID or slug of the stack to install SM on.

stackSmApiUrl 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/synthetic-monitoring/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.

Package Details

Repository
grafana lbrlabs/pulumi-grafana
License
Apache-2.0
Notes

This Pulumi package is based on the grafana Terraform Provider.