Section 2 · Grafana resources and Terraform

What it means to manage Grafana resources as code and how Terraform fits in

Estimated time: 1 min

What “resources as code” means

When you manage Grafana resources as code, you define them in configuration files instead of configuring them through the UI. Those files live in version control, go through code review, and deploy through a pipeline.

Manual (UI)As code (Terraform)
Click through forms to create an alert ruleWrite an HCL block that defines the rule
Changes aren’t trackedEvery change is a Git commit
Hard to replicate across environmentsSame code deploys to staging and production
No review processPull requests catch mistakes before they reach Grafana

What resources can you manage?

Grafana isn’t just dashboards. You can manage a wide range of resources across the entire Grafana ecosystem as code.

CategoryExamples
VisualizationDashboards, folders, library panels, playlists
AlertingAlert rule groups, contact points, notification policies, mute timings, message templates
DataData sources, data source permissions
Access controlService accounts, teams, users, roles, RBAC
PlatformOrganizations, SLOs, plugins, annotations
Grafana CloudCloud stacks, access policies, Fleet Management, IRM/OnCall