Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/grafana-cloud/learn-and-build/as-code.md, or by sending Accept: text/markdown to https://grafana.com/docs/grafana-cloud/learn-and-build/as-code/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
Deploy, provision and manage Grafana with as code workflows
Note
Looking for
gcx? Have a look at the new AI tools section!
Overview of as code and provisioning
Provisioning and as code let you apply code management best practices to your observability resources. By representing Grafana resources as code, you can integrate them into existing infrastructure-as-code workflows and apply standard development practices. Instead of manually configuring dashboards or settings through the Grafana UI, you can:
- Write configurations in code: Define dashboards in JSON or other supported formats.
- Sync your Grafana setup to GitHub: Track changes, collaborate, and roll back updates using Git and GitHub, or other remote sources.
- Automate with CI/CD: Integrate Grafana directly into your development and deployment pipelines.
- Standardize workflows: Ensure consistency across your teams by using repeatable, codified processes for managing Grafana resources.
Note
For basic configuration provisioning refer to Provision Grafana.
Explore
Explore the available as code tools. Most can be used with one another.
gcx to push your programmatically generated resources.Choose a tool
Use the following table to find the tool that fits your workflow. You can combine tools, but give each resource a single owner so that one tool doesn’t overwrite changes made by another.
| I want to | Use | Why |
|---|---|---|
| Manage Grafana Cloud stacks and resources across Grafana products from one configuration | Terraform | The Grafana Terraform provider supports the most Grafana resources, and fits Terraform workflows such as reviewing changes with terraform plan and applying them from CI/CD. |
| Edit dashboards in the Grafana UI and store them in Git | Git Sync | Git Sync synchronizes dashboard files between a GitHub repository and Grafana, with version control, branching, and pull requests directly from Grafana. |
| Load dashboards and folders from files on the server that runs Grafana | On-prem file provisioning | Grafana reads the resources from a local file system, so you don’t need external tooling. |
| Manage Grafana Cloud resources from Ansible playbooks | Ansible | The Grafana Ansible collection manages Grafana Cloud resources, including folders and cloud stacks, alongside the rest of your Ansible automation. |
| Run Grafana in Kubernetes and manage its resources as custom resources | Grafana Operator | The Grafana Operator provisions and operates Grafana instances and manages their dashboards, folders, and data sources through Kubernetes custom resources. |
| Define any Terraform-supported resource as a Kubernetes manifest | Grafana Crossplane provider | The Crossplane provider is built from the Terraform provider and supports all of its resources, so it fits GitOps pipelines built on tools like Argo CD. |
| Generate dashboards from code | Foundation SDK | You define dashboards in Go, TypeScript, Python, Java, or PHP, and push the generated resources with gcx. |
| Inspect, pull, and push resources from the command line or with an AI agent | Grafana CLI | gcx manages resources across Grafana and Grafana Cloud with one set of commands, and works for both people and agents. |
Additional as code tools
gcx is the Grafana command-line tool for provisioning Grafana and Grafana Cloud resources. You can also provision resources with other
AI tools:
- Grafana Assistant: Create and update dashboards in plain language, directly in the Grafana UI. Refer to Grafana Assistant.
- MCP servers: Let an external AI client, such as Claude, Cursor, or VS Code with Copilot, manage dashboards, folders, alerting, and other resources through the Model Context Protocol. Refer to MCP server.
These tools work well for exploring and drafting changes. To keep changes durable, move them into version-controlled files and apply them with gcx or another as-code tool. For a comparison of the AI tools, refer to
AI tools.
Grafonnet is a Jsonnet library for generating Grafana dashboard JSON definitions programmatically. Grafonnet is not officially supported by Grafana. Instead, use the Foundation SDK to create dashboards as code.
Grizzly has been removed, and is no longer deployed, enhanced, or supported. Use
gcx instead.
Was this page helpful?
Related resources from Grafana Labs


