Open in Grafana Cloud
Complete this learning path directly in your Grafana Cloud stack, or in the Grafana Play stack, with an interactive learning experience.
Deploy an alert rule with Terraform
Welcome to the learning path that shows you how to deploy a complete Grafana alerting pipeline using the Grafana Terraform provider. You’ll define an alert rule group, a contact point, and a notification policy in HCL, then deploy them with Terraform’s plan-and-apply workflow.
The Grafana Terraform provider lets you manage alerting resources alongside your other infrastructure. Same tool, same state management, same deployment process.
Here’s what to expect
When you complete this journey, you’ll be able to:
- Create a Grafana service account token for Terraform authentication
- Configure the Grafana Terraform provider
- Define a
grafana_folderto organize alert rules - Define a
grafana_rule_groupwith a working alert rule - Define a
grafana_contact_pointfor notifications - Define a
grafana_notification_policyto route alerts - Run
terraform planto preview changes before applying - Run
terraform applyto deploy the full alerting pipeline to Grafana
Before you begin
Before you deploy an alert rule with Terraform, ensure you have:
- A Grafana Cloud account or self-managed Grafana instance (version 12 or higher)
- Terraform installed (version 1.0 or later)
- A data source configured in Grafana (for example, Prometheus or Grafana TestData)
- Admin or Editor permissions on your Grafana instance
Troubleshooting
If you get stuck, we’ve got your back! Where appropriate, troubleshooting information is just a click away.
More to explore
We understand you might want to explore other capabilities not strictly on this path. We’ll provide you opportunities where it makes sense.