Developers use macOS laptops while CI runs on Linux, and `terraform init` in CI complains about missing checksums. What's wrong?
IntermediateScenarioWorkflow and Providers
Answer
Situation read → The lock file only has hashes for the platform that generated it.
What I'd do →
- Regenerate hashes for every platform in use.
- Commit the updated lock file.
terraform providers lock \
-platform=linux_amd64 -platform=linux_arm64 \
-platform=darwin_arm64 -platform=darwin_amd64
Why → init verifies downloaded provider archives against h1:/zh: hashes. A lock file generated on a Mac lacks the Linux archive hash, so verification fails or warns.
Interview tip → Add this to the contributing guide so provider bumps always include all platforms.
More on Workflow and Providers
A new teammate is about to run Terraform for the first time against a shared dev account. Which commands do you walk them through, and in what order?BeginnerYour manager asks why we bother with `terraform plan` when `apply` shows the same diff before asking for confirmation. What do you say?BeginnerTwo engineers get different provider versions and see different plans for the same code. How do you stop this?BeginnerSomeone committed the `.terraform/` directory to the repo. What should be in version control and what should not?BeginnerThe same configuration must create a VPC in `us-east-1` and a DR copy of a bucket in `eu-west-1`. How do you do it with one root module?IntermediateYou must deploy the same stack into 12 AWS accounts. How do you handle credentials and provider configuration?Intermediate