One Giant Terraform State Runs Everything
A single Terraform state holds all your infra; every plan is slow and scary. A teammate wants to just keep applying carefully. Defend how you reduce the blast radius.
Answer key reviewed by Branko Petric
Read first: Terraform State Explained
Your decision
All of your infrastructure lives in one giant Terraform state. plan takes 10 minutes, every apply touches production-critical resources, and people are scared to run it. A teammate says just keep applying carefully. How do you fix this safely?
The situation
Your team's entire cloud footprint - networking, databases, clusters, app resources - is managed in a single Terraform state. terraform plan takes around 10 minutes, and any apply could, in principle, modify production-critical resources.
Context
People have started avoiding Terraform changes because every apply feels dangerous, and small changes pile up. The state is in a shared remote backend with locking. A teammate's only suggestion is to keep using the single state but be very careful with each apply.
Related challenges
- Terraform Wants to Replace the Database. Apply Now?
A routine terraform plan unexpectedly wants to destroy and recreate the production database. Defend whether to apply, and how.
- Someone Changed Infra by Hand. Terraform Plan Is a Mess.
A manual console change put Terraform's state out of sync, and the next plan wants to undo it. Defend how you reconcile it.
- Terraform Doesn't Know the Hand-Made DB. Let It Build a New One?
A prod RDS instance was made by hand and Terraform's plan wants to create a new one. A teammate says just apply. Defend what you actually do first.
- Commit terraform.tfstate to the Repo So Everyone Shares It?
A teammate wants to commit terraform.tfstate to git so the whole team shares one state file. Defend the correct way to share Terraform state.