> For the complete documentation index, see [llms.txt](https://docs.groundcover.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.groundcover.com/reference/embedded-grafana/embedded-grafana-dashboards/build-alerts-and-dashboards-with-grafana-terraform-provider.md).

# Build alerts & dashboards with Grafana Terraform provider

{% hint style="info" %}
groundcover enables access to an embedded Grafana, within the groundcover platform's interface.&#x20;

This option is turned off by default. If required, reach out to the groundcover team to enable it.
{% endhint %}

## Configure the Grafana Terraform provider

For instructions on how to generate a Grafana Service Account Token and use it in the Grafana Terraform provider, see: [Grafana Service Account Token](/reference/remote-access-and-apis/build-alerts-and-dashboards-with-grafana-terraform-provider.md).

## Dashboard provisioning example

* Create a directory for the terraform assets

  ```bash
  mkdir groundcover-tf-example && cd groundcover-tf-example
  ```
* Create a `main.tf` file within the directory that contains the terraform provider configuration mentioned in step 2
* Create the following `dashboards.tf` file, this example declares a new `Golden Signals` folder, and within it a `Workload Golden Signals` dashboard that will be created

```hcl
resource "grafana_folder" "goldensignals" {
  title = "Golden Signals"
}

resource "grafana_dashboard" "workloadgoldensignals" {
  config_json = file("workloadgoldensignals.json")
  folder = grafana_folder.goldensignals.id
}
```

* add the `workloadgoldensignals.json` file to the directory as well

{% file src="/files/GryYyKjAWqnr8CyxKWg7" %}

* Run `terraform init` to initialize terraform context
* Run `terraform plan` , you should see a long output describing the assets that are going to be created last line should state\
  `Plan: 2 to add, 0 to change, 0 to destroy.`
* Run `terraform apply` to execute the changes, you should now see a new folder in your grafana dashboards screen with the newly created dashboard
* Run `terraform destroy` to revert the changes

Here is a short video to demonstrate the process

{% embed url="<https://www.loom.com/share/c0dabc965dcf45a1854f3d68e777fb5b?sid=1519a6a8-97f0-42ef-80a7-22335b04b681>" %}

You can read more about what you can achieve with the Grafana Terraform provider in the [official docs](https://registry.terraform.io/providers/grafana/grafana/latest/docs)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.groundcover.com/reference/embedded-grafana/embedded-grafana-dashboards/build-alerts-and-dashboards-with-grafana-terraform-provider.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
