Read script
Script
Four principles to take with you.
First, Grafana resources deserve the same rigor as infrastructure. Version control, code review, automated deployment. If you do it for servers, do it for alert rules and notification policies.
Second, Terraform’s state management prevents drift and duplicates. The state file tracks what Terraform deployed, so manual UI edits get corrected on the next run.
Third, the alerting pipeline is three resources working together. Alert rule groups define when to fire, contact points define where notifications go, and notification policies define how alerts are routed.
Fourth, the pipeline is the source of truth. Once you have CI/CD in place, the code on main is always what’s deployed. Manual edits get corrected on the next run.