For instructions on how to generate a Grafana Service Account Token and use it in the Grafana Terraform provider, see: Grafana Service Account Token.
Create a directory for the terraform assets
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
add the workloadgoldensignals.json file to the directory as well
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
Here is a short video to demonstrate the process
You can read more about what you can achieve with the Grafana Terraform provider in the
Run terraform destroy to revert the changes
mkdir groundcover-tf-example && cd groundcover-tf-exampleresource "grafana_folder" "goldensignals" {
title = "Golden Signals"
}
resource "grafana_dashboard" "workloadgoldensignals" {
config_json = file("workloadgoldensignals.json")
folder = grafana_folder.goldensignals.id
}