---
title: "Deploy an alert rule learning path | Grafana Labs"
description: "Hands-on learning path to deploy an alert rule with Terraform"
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

## Learning path: Deploy an alert rule with Terraform

The following table describes the steps you’ll work through in the learning path.

| Step                                           | What you’ll do                                                                                 | Outcome                                                            |
|------------------------------------------------|------------------------------------------------------------------------------------------------|--------------------------------------------------------------------|
| **1. Why Terraform?**                          | Understand why Terraform is a natural fit for deploying alerting resources                     | Context for choosing Terraform over manual workflows               |
| **2. Create a service account**                | Set up API credentials in Grafana for Terraform                                                | A service account token for authentication                         |
| **3. Configure the provider**                  | Declare the Grafana Terraform provider and authenticate                                        | Terraform connected to your Grafana instance                       |
| **4. Define a folder and an alert rule group** | Create a folder to organize your alert rules, anda `grafana_rule_group` with a CPU usage alert | An organizational folder and alert rule ready to deploy in Grafana |
| **5. Add a contact point**                     | Define a `grafana_contact_point` for Slack or email                                            | A notification destination configured                              |
| **6. Add a notification policy**               | Route alerts to the contact point based on labels                                              | A complete alerting pipeline                                       |
| **7. Run terraform plan**                      | Preview what Terraform will create in Grafana                                                  | Confidence in what will change before applying                     |
| **8. Apply and verify**                        | Run `terraform apply` and confirm the resources appear in Grafana                              | A live alerting pipeline deployed from code                        |

## Before you start

Have these ready before you open the path:

- A Grafana Cloud account or self-managed Grafana instance (version 12 or higher)
- [Terraform](https://www.terraform.io/downloads) 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

Learning path

#### Deploy an alert rule with Terraform

Deploy a complete Grafana alerting pipeline using the Terraform provider.

17 min

Advanced

Docs &amp; blog posts

#### 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.

[Open in Grafana Cloud]() [Try in Grafana Play]()

[View on website](/docs/learning-paths/deploy-alert-terraform/)
