---
title: "Provision Synthetic Monitoring resources | Grafana Cloud documentation"
description: "Use Terraform, Grizzly, or the Grafana API to manage synthetic monitoring resources such as checks and probes"
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# Provision Synthetic Monitoring resources

The [Grafana Terraform provider](https://registry.terraform.io/providers/grafana/grafana/latest/docs) has support for managing Synthetic Monitoring [checks](https://registry.terraform.io/providers/grafana/grafana/latest/docs/resources/synthetic_monitoring_check) and [probes](https://registry.terraform.io/providers/grafana/grafana/latest/docs/resources/synthetic_monitoring_probe). If you already have checks or probes created via the UI, you can export an initial Terraform configuration from the `Config` tab of the Synthetic monitoring plugin.

In a `grafana_synthetic_monitoring_check` resource, the block inside `settings` sets the check type. The block name is the [check type identifier](/docs/grafana-cloud/testing/synthetic-monitoring/create-checks/checks/#check-type-identifiers), so a MultiHTTP check uses a `multihttp` block and a k6 scripted check uses a `scripted` block.

This example loads a k6 script from `script.js`. Save your script in that file in the same directory as your Terraform configuration.

hcl ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```hcl
data "grafana_synthetic_monitoring_probes" "main" {}

resource "grafana_synthetic_monitoring_check" "scripted" {
  job     = "Validate homepage"
  target  = "https://grafana.com/"
  enabled = true
  probes = [
    data.grafana_synthetic_monitoring_probes.main.probes.Paris,
  ]
  settings {
    scripted {
      script = file("${path.module}/script.js")
    }
  }
}
```

For the settings each check type accepts, refer to the [`grafana_synthetic_monitoring_check` resource](https://registry.terraform.io/providers/grafana/grafana/latest/docs/resources/synthetic_monitoring_check) documentation.

> Note
> 
> You need a Synthetic Monitoring access token to use the Grafana Terraform provider to manage resources.
> 
> You can get an access token by navigating to the **Config** tab of the Synthetic Monitoring plugin or [via the API](https://registry.terraform.io/providers/grafana/grafana/latest/docs#authentication).
> 
> Synthetic Monitoring access tokens don’t have an expiration date.
> 
> Synthetic Monitoring access tokens don’t support role-based access control (RBAC). This means all access tokens have the same level of access and cannot be scoped or restricted to specific resources or actions.

Alternatively, you can use [Grizzly](https://github.com/grafana/grizzly), a command-line tool, to manage your synthetic monitoring resources in code.

Another option is the [Synthetic Monitoring API](https://github.com/grafana/synthetic-monitoring-api-go-client/blob/master/docs/API.md), ideal for those who prefer not to use Terraform or Grizzly but still want to manage their Synthetic Monitoring checks programmatically.

> Note
> 
> Custom labels on provisioned checks and probes can’t use reserved system label names: the API rejects create and update requests that use them, whichever provisioning tool you use. For the list of reserved names, refer to [System labels](/docs/grafana-cloud/testing/synthetic-monitoring/system-labels/). To rename a label key across every check in your tenant, for example when preparing for the [label migration](/docs/grafana-cloud/testing/synthetic-monitoring/migrate-labels/), use the [`POST /api/v1/check/labels/{key}`](https://synthetic-monitoring-api.grafana.net/api/v1/swagger#/operations/POST_/api/v1/check/labels/:key) endpoint, and update your Terraform definitions to match.
