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

Script

Grafana isn’t just dashboards. It’s an ecosystem of resources: alert rules, contact points, notification policies, data sources, folders, service accounts, SLOs, and more. Each of these can be defined as code and managed through automated workflows.

When you manage resources as code, you define them in configuration files instead of clicking through the UI. Those files live in version control, go through code review, and are deployed by a pipeline. The result: consistency, traceability, and repeatability across environments.

This journey uses alert rules as the example resource, but the same patterns apply to any resource the Grafana Terraform provider supports. The next slide introduces the provider and the resources it can manage.