Install the Grafana Terraform provider

The Grafana Terraform provider enables you to manage Grafana Cloud resources using Terraform configuration files. Installing and configuring this provider is your first step toward managing your observability platform as code.

To install the Grafana Terraform provider, complete the following steps:

  1. Create a new directory for your Terraform configuration:

    sh
    mkdir grafana-terraform
    cd grafana-terraform
  2. Create a file named provider.tf with the following content:

    hcl
    terraform {
      required_providers {
        grafana = {
          source  = "grafana/grafana"
          version = "~> 3.0"
        }
      }
    }
    
    provider "grafana" {
      url  = "https://<YOUR_STACK>.grafana.net"
      auth = "<YOUR_SERVICE_ACCOUNT_TOKEN>"
    }
  3. Replace <YOUR_STACK> with your Grafana Cloud stack name.

  4. Replace <YOUR_SERVICE_ACCOUNT_TOKEN> with your service account token that starts with glsa_.

  5. Initialize Terraform to download the provider:

    sh
    terraform init

The output confirms Terraform has downloaded and initialized the Grafana provider successfully.

In the next milestone, you’ll configure SAML authentication with external group synchronization.


page 3 of 12