Managing Dashboards with Terraform
Create & manage dashboards with Terraform
Use Terraform to create, update, delete, and list groundcover dashboards as code. Managing dashboards with infrastructure‑as‑code (IaC) lets you version changes, review them in pull requests, promote the same definitions across environments, and detect drift between what’s applied and what’s running in your account.
Prerequisites
A groundcover account with permissions to create/edit Dashboards
A Terraform environment (groundcover provider >v1.1.1)
The groundcover Terraform provider configured with your API credentials
See also: groundcover Terraform provider reference for provider configuration and authentication details.
1) Creating a Dashboard via Terraform
1.1) Create a dashboard directly from the UI
In order to create a dashboard using Terraform you first need to create a dashboard manually in order to export it in a Terraform format.
See Creating dashboards to learn more.
1.2) Export the dashboard in Terraform format
You can export a Dashboard into as a Terraform resource:
Open the Dashboard.
Click Actions → Export.
Download or copy the Terraform tab’s content and paste it into your
.tffile (see placeholder above).

1.3) Add the dashboard resource to your Terraform configuration
After saving this file as main.tf along with the provider details, type:
2) Managing existing provisioned Dashboard
2.1) "Provisioned" badge for IaC‑managed Dashboards
Dashboards added via Terraform are marked as Provisioned in the UI so you can quickly distinguish IaC‑managed Dashboards from manually created ones, both from the Dashboard List and inside the Dashboard itself.

2.2) Edit behavior for Provisioned Dashboards
Provisioned Dashboards are read‑only by default to protect the source of truth in your Terraform code.
To make a quick change, click Unlock dashboard. This allows editing directly in the UI, all changes are automatically saved as always.\

Important: Any changes can be overwritten the next time your provisioner runs
terraform apply.Safer alternative: Duplicate the Dashboard and edit the copy, then migrate those changes back into code.
2.3) Editing dashboards via Terraform
Changing the resource and reapplying Terraform willupdate the Dashboard in groundcover.
Deleting the resource from your code (and applying) will delete it from groundcover.
See more examples on our Github repo.
3) Importing existing Dashboards into Terraform
Already have a Dashboard in groundcover? Bring it under Terraform management without recreating it:
After importing, run terraform plan to view the state and align your config with what exists.
Reference
Creating dashboars – how to build widgets and layouts in the UI
groundcover Terraform provider Github repo – resource schema, arguments, and examples
Last updated
