Interview Prep/Terraform/State and Backends in Production

What is partial backend configuration and why use it?

BeginnerProductionState and Backends in Production
Answer

You keep only the static parts in the backend block and supply environment-specific values at init time.

terraform { backend "s3" {} }
terraform init -backend-config=env/prod.backend.hcl

Where prod.backend.hcl has bucket, key and region. It lets one codebase target several accounts without editing files.

All Terraform questions Roadmap: Terraform in production

More on State and Backends in Production