~/writing/notes/terraform-state-rules
evergreenThree rules for Terraform state
Remote, locked, and small. Most Terraform pain is one giant state file that everyone is afraid to plan.
planted 1 min read
- Remote and locked. S3 + DynamoDB lock (or native S3 locking). Local state is a bug.
- Small blast radius. One state per environment per component (network, data, apps). A plan should finish in seconds.
- Drift is a ticket, not a surprise. Run
plan -detailed-exitcodenightly and open an issue on exit code 2. See Terraform drift detection that opens GitHub issues.
Book: Terraform: Up & Running (3rd edition). Practice: infra-ops: one Terraform + Ansible platform for dev, staging and prod, Infrastructure as Code: Bridging Terraform and Ansible.
Links from this note
Mar 12, 2026Terraform drift detection that opens GitHub issuesDrift is not a Terraform problem, it's a feedback-loop problem. Here is the nightly job that re-plans every environment and files an issue when reality disagrees with code.Read Dec 5, 2025Terraform: Up & Running (3rd edition)The book that turned my Terraform from scripts into a platform. Most of infra-ops is this book plus scars.Read Feb 20, 2026infra-ops: one Terraform + Ansible platform for dev, staging and prodRead Jun 10, 2026Infrastructure as Code: Bridging Terraform and AnsibleA deep dive into how Terraform and Ansible complement each other in modern infrastructure provisioning and configuration management.Read