Interview Prep/Terraform/Workflow and Providers

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 →

  1. Regenerate hashes for every platform in use.
  2. 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.

All Terraform questions Roadmap: Terraform

More on Workflow and Providers