---
title: "Provision Grafana resources with Terraform | Grafana documentation"
description: "Provision Grafana resources with Terraform The Grafana Terraform provider provisions configuration management resources for Grafana. If you’re a Grafana administrator you can manage dashboards, data sources, plugins, alerts and collectors, add synthetic monitoring probes and checks, manage identity and access, and more, using the Terraform provider."
---

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

# Provision Grafana resources with Terraform

The [Grafana Terraform provider](https://registry.terraform.io/providers/grafana/grafana/latest) provisions configuration management resources for Grafana. If you’re a Grafana administrator you can manage dashboards, data sources, plugins, alerts and collectors, add synthetic monitoring probes and checks, manage identity and access, and more, using the Terraform provider.

> Note
> 
> The resources you can manage depend on the permissions of the credentials you configure in the provider. Use a [service account](https://grafana.com/docs/grafana/latest/administration/service-accounts/) with the roles that the resources need. For Grafana Cloud resources, use a token from an [access policy](https://grafana.com/docs/grafana-cloud/account-management/authentication-and-permissions/access-policies/) with the required scopes. To learn more, refer to [Roles and permissions](https://grafana.com/docs/grafana/latest/administration/roles-and-permissions/).

## Why use the Terraform provider

To manage the entire Grafana ecosystem of resources on either Grafana Cloud or OSS deployments of Grafana, the Grafana Terraform provider supports the most Grafana resources compared to other as-code solutions.

The Terraform provider is a good fit when you want to:

- **Manage everything from one configuration:** Create a Grafana Cloud stack, its access policies and tokens, and the resources inside it, such as folders, data sources, dashboards, and alerts, in the same Terraform configuration.
- **Use your existing Terraform workflow:** Review changes with `terraform plan`, keep configuration in version control, and apply changes from CI/CD pipelines such as GitHub Actions.
- **Manage Grafana alongside your infrastructure:** Provision Grafana resources in the same configuration as the cloud infrastructure they monitor, for example AWS accounts and Microsoft Azure credentials for Cloud Provider Observability.
- **Use Kubernetes manifests instead of HCL:** The [Grafana Crossplane provider](https://grafana.com/docs/grafana/latest/as-code/grafana-operator/#grafana-crossplane-provider) is built from the Terraform provider and supports all of its resources as Kubernetes custom resources.

To compare Terraform with the other as-code tools, refer to [Choose a tool](https://grafana.com/docs/grafana/latest/as-code/#choose-a-tool).

## Terraform guides by area

The following table lists the Grafana areas and Grafana Cloud products that have a Terraform guide, what you can do with Terraform in each area, which Grafana editions support it, and where to find the guides. For the complete list of resources and data sources, refer to the [Grafana provider documentation](https://registry.terraform.io/providers/grafana/grafana/latest/docs).

Expand table

| Area                             | What you can do with Terraform                                                                                                                                                          | Availability           | Guides                                                                                                                                                                                                                                                                                                                                                           |
|----------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Alerting**                     | Provision alert rules, contact points, notification templates, mute timings, and notification policy trees, and optionally allow editing them in the Grafana UI.                        | Cloud, Enterprise, OSS | [Use Terraform to provision alerting resources](https://grafana.com/docs/grafana/latest/alerting/set-up/provision-alerting-resources/terraform-provisioning/)                                                                                                                                                                                                    |
| **Cloud Provider Observability** | Configure AWS accounts, Amazon CloudWatch metrics and resource metadata scrape jobs, and Microsoft Azure credentials.                                                                   | Cloud                  | [Manage Cloud Provider Observability in Grafana Cloud using Terraform](https://grafana.com/docs/grafana/latest/as-code/terraform/terraform-cloud-provider-o11y/)                                                                                                                                                                                                 |
| **Dashboards**                   | Create folders and manage multiple dashboards stored as JSON source code, and deploy changes with GitHub Actions.                                                                       | Cloud, Enterprise, OSS | [Create and manage dashboards using Terraform and GitHub Actions](https://grafana.com/docs/grafana/latest/as-code/terraform/dashboards-github-action/)                                                                                                                                                                                                           |
| **Fleet Management**             | Preregister collectors before they’re operational, add remote attributes to registered collectors, and create configuration pipelines that can’t be edited in the Fleet Management app. | Cloud                  | [Managing Fleet Management in Grafana Cloud using Terraform](https://grafana.com/docs/grafana-cloud/as-code/terraform/terraform-fleet-management/), [Terraform and Fleet Management](https://grafana.com/docs/grafana-cloud/send-data/fleet-management/set-up/infrastructure-as-code/terraform/)                                                                 |
| **Frontend Observability**       | Create the access policy and token that let the provider manage Frontend Observability resources.                                                                                       | Cloud                  | [Managing Frontend Observability in Grafana Cloud using Terraform](https://grafana.com/docs/grafana-cloud/as-code/terraform/terraform-frontend-observability/)                                                                                                                                                                                                   |
| **Git Sync**                     | Create the connection and repository resources that synchronize a Git repository with Grafana.                                                                                          | Cloud, Enterprise, OSS | [Set up Git Sync with Terraform](https://grafana.com/docs/grafana/latest/as-code/git-sync/git-sync-setup/set-up-terraform/)                                                                                                                                                                                                                                      |
| **Grafana Assistant**            | Manage Assistant rules, skills, quickstarts, MCP servers, and terms acceptance.                                                                                                         | Cloud (refer to note)  | [Manage Grafana Assistant with Terraform](https://grafana.com/docs/grafana-cloud/machine-learning/assistant/configure/terraform/)                                                                                                                                                                                                                                |
| **Grafana Cloud integrations**   | Install, update, and remove the dashboards and alerts of Grafana Cloud integrations.                                                                                                    | Cloud                  | [Install and manage integrations using Terraform](https://grafana.com/docs/grafana-cloud/monitor-infrastructure/integrations/manage-integrations-using-terraform/)                                                                                                                                                                                               |
| **Grafana Cloud stacks**         | Create a Grafana Cloud stack with a service account and token, and add a folder, a data source, and a dashboard to it.                                                                  | Cloud                  | [Create and manage a Grafana Cloud stack using Terraform](https://grafana.com/docs/grafana/latest/as-code/terraform/terraform-cloud-stack/)                                                                                                                                                                                                                      |
| **IRM**                          | Connect integrations and routes, configure escalation chains and policies, define on-call schedules and shifts, and manage outgoing webhooks and personal notification rules.           | Cloud                  | [Managing IRM on Grafana Cloud using Terraform](https://grafana.com/docs/grafana/latest/as-code/terraform/terraform-oncall/), [Infrastructure as code](https://grafana.com/docs/grafana-cloud/alerting-and-irm/irm/set-up/infra-as-code/), [Schedules as code](https://grafana.com/docs/grafana-cloud/alerting-and-irm/irm/on-call-schedules/schedules-as-code/) |
| **Knowledge Graph**              | Manage notification alerts, suppressed assertions, custom model rules, log, trace, and profile configurations, thresholds, and Prometheus rules.                                        | Cloud                  | [Manage Knowledge Graph in Grafana Cloud using Terraform](https://grafana.com/docs/grafana/latest/as-code/terraform/terraform-knowledge-graph/)                                                                                                                                                                                                                  |
| **Machine Learning**             | Create forecasts, holidays, and outlier detectors, and their alert rules.                                                                                                               | Cloud                  | [Provision Machine Learning resources using Terraform](https://grafana.com/docs/grafana-cloud/ai-tools/machine-learning/additional-configuration/terraform/)                                                                                                                                                                                                     |
| **Plugins**                      | Install plugins in a Grafana Cloud stack.                                                                                                                                               | Cloud (refer to note)  | [Install plugins in Grafana Cloud using Terraform](https://grafana.com/docs/grafana/latest/as-code/terraform/terraform-plugins/)                                                                                                                                                                                                                                 |
| **Role-based access control**    | Set basic roles for users and service accounts, create custom roles, and assign fixed or custom roles to users, teams, and service accounts.                                            | Cloud, Enterprise      | [Provisioning RBAC with Terraform](https://grafana.com/docs/grafana/latest/administration/roles-and-permissions/access-control/rbac-terraform-provisioning/)                                                                                                                                                                                                     |
| **Saved queries**                | Create saved queries in the query library and import existing saved queries into Terraform.                                                                                             | Cloud, Enterprise      | [Manage saved queries using Terraform](https://grafana.com/docs/grafana/latest/as-code/terraform/manage-saved-queries/)                                                                                                                                                                                                                                          |
| **Secrets Management**           | Create, rotate, and manage secure values, and configure and activate the keepers that store them.                                                                                       | Cloud                  | [Manage secrets in Grafana Cloud using Terraform](https://grafana.com/docs/grafana/latest/as-code/terraform/terraform-secrets-management/)                                                                                                                                                                                                                       |
| **SLO**                          | Define SLOs, export existing SLOs as Terraform, and import them into Terraform state. Grafana generates the recording rules, dashboards, and alerts for each SLO.                       | Cloud                  | [Provision SLO resources using Terraform](https://grafana.com/docs/grafana-cloud/alerting-and-irm/slo/set-up/terraform/)                                                                                                                                                                                                                                         |
| **Workflows**                    | Create, update, and delete workflows from YAML definitions. Grafana Workflows is in public preview.                                                                                     | Cloud                  | [Use Terraform](https://grafana.com/docs/grafana-cloud/platform/workflows/as-code/use-terraform/)                                                                                                                                                                                                                                                                |

> Note
> 
> **Grafana Assistant** and **Plugins** are listed as Grafana Cloud only because of how their Terraform resources work:
> 
> - **Grafana Assistant:** You can run [Grafana Assistant](https://grafana.com/docs/grafana/latest/ai-tools/grafana-assistant/) in self-managed Grafana by connecting it to a Grafana Cloud stack, but the Terraform resources require a Grafana Cloud stack with Assistant enabled.
> - **Plugins:** The `grafana_cloud_plugin_installation` resource only works with Grafana Cloud stacks. To install plugins in self-managed Grafana, refer to [Install a plugin](https://grafana.com/docs/grafana/latest/administration/plugin-management/plugin-install/).
