Why pin the Terraform version in CI and how?
BeginnerProductionCI/CD and Automation
Answer
Different CLI versions produce different plans and may write state in a format that older versions cannot read. Pin required_version in code, read the version from .terraform-version in the pipeline and upgrade through a PR that runs plans for every stack to confirm no diffs.
More on CI/CD and Automation
Why run Terraform from a pipeline instead of laptops?BeginnerWhat stages does a good Terraform pull-request pipeline have?BeginnerHow do you make sure the apply runs exactly what was reviewed?IntermediateHow do you serialize applies to the same stack in CI?AdvancedShow a minimal GitHub Actions workflow for plan on PR.BeginnerHow does OIDC authentication from GitHub Actions to AWS work?Intermediate