Interview Prep/Terraform/Partial Applies, Version Mismatches and CI Failures

OpenTofu migration: after switching CI to `tofu`, `init` shows provider downloads from `registry.opentofu.org` and the lock file diff changes all hashes.

IntermediateTroubleshootingPartial Applies, Version Mismatches and CI Failures
Answer

Likely causes → OpenTofu resolves the default hashicorp/aws source against its own registry, so lock file entries and hashes differ from Terraform's.

Diagnose → git diff .terraform.lock.hcl shows registry.opentofu.org/hashicorp/aws.

Fix → Commit the regenerated lock file once everyone moves to OpenTofu. Don't alternate between terraform and tofu on the same state; newer features diverge.

Prevent → Pick one tool per repo and pin its version; run tofu providers lock for all platforms.

All Terraform questions

More on Partial Applies, Version Mismatches and CI Failures