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.
the decision you defend
Two engineers ran terraform apply from their laptops and got conflicting results. A teammate proposes committing terraform.tfstate to the git repo so everyone shares the same state. Do you agree, and what do you do instead?
the situation
Your team manages infrastructure with Terraform. Two engineers ran terraform apply from their own laptops against the same environment and ended up with divergent state and a resource that exists in the cloud but not in either local state file. Applies are now producing confusing plans that want to create things that already exist.
context
Each engineer has their own local terraform.tfstate on disk. There is no shared backend configured. The Terraform configuration provisions an RDS database, so the state includes the generated master password in plaintext. A teammate suggests committing terraform.tfstate to the git repository so everyone pulls the same state before running apply.
How this challenge works
Take a position on the decision above and defend it. A senior-engineer AI will push back over up to 5 rounds. When you are done, you are scored against a verified rubric so you can see exactly what a complete answer covers - these are learning prompts, not gotchas.