How do you migrate a repo from Terraform 1.6 to OpenTofu?
IntermediateScenarioPipelines Terraform Cloud and OpenTofu
Answer
Situation read → Drop-in replacement, but verify.
What I'd do →
- Back up state; confirm Terraform version is within the compatible range from the OpenTofu migration guide.
- Install
tofu, runtofu init(it uses the OpenTofu registry) and regenerate the lock file. - Run
tofu plan; expect an empty plan. - Update CI, Docker images and docs.
tofu init -upgrade
tofu plan
Why → State format is compatible within supported version ranges; an empty plan is the test.
Interview tip → Moving back isn't guaranteed after newer OpenTofu features write state.
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