How do you keep the Terraform version consistent between laptops and CI?
BeginnerScenarioPipelines Terraform Cloud and OpenTofu
Answer
Situation read → Version skew produces confusing plan differences.
What I'd do →
- Commit a
.terraform-version(tfenv) or.tool-versions(mise/asdf) file. - In CI, read it:
terraform_version_fileinsetup-terraform. - Set
required_versionin code as the hard stop.
Why → One source of truth for the version and a guard in the code.
Interview tip → Bump the version in one PR with a clean plan in every environment.
More on Pipelines Terraform Cloud and OpenTofu
Build a basic GitHub Actions pipeline: plan on pull request, apply on merge to main.BeginnerReviewers can't read raw plan logs. How do you present the plan in the PR?IntermediateTwo PRs merge close together and both apply to the same stack. What prevents trouble?IntermediateHow do you add a manual approval before prod applies?IntermediateCompare Atlantis, HCP Terraform and a hand-built GitHub Actions pipeline.IntermediateA saved plan was approved yesterday and apply fails because main changed. How do you avoid dead approvals?Intermediate