Interview Prep/Terraform/Repository Structure, Environments and Module Strategy

How do you pin the Terraform version across a team?

BeginnerProductionRepository Structure, Environments and Module Strategy
Answer

Use required_version = "~> 1.9" in code and a version manager that reads .terraform-version or .tool-versions (tfenv, mise, asdf). CI installs the same version with hashicorp/setup-terraform and terraform_version. This avoids the "newer version wrote state" problem.

All Terraform questions Roadmap: Terraform in production

More on Repository Structure, Environments and Module Strategy