Interview Prep/Terraform/State and Backends in Production

Why should Terraform state never be committed to Git?

BeginnerProductionState and Backends in Production
Answer

State holds secrets in plaintext, has no locking, and merge conflicts on a JSON file with a serial number are a recipe for corruption. In production we use a remote backend with locking, encryption and versioning, and .gitignore all *.tfstate* files.

All Terraform questions Roadmap: Terraform in production

More on State and Backends in Production