Interview Prep/Terraform/IaC and Terraform Fundamentals

What is `.terraform.lock.hcl` and should it be committed?

IntermediateConceptIaC and Terraform Fundamentals
Answer

The dependency lock file records the exact provider versions and checksums selected by terraform init. Commit it, so every engineer and CI run uses identical providers. Update it deliberately with terraform init -upgrade. For multi-OS teams run terraform providers lock -platform=linux_amd64 -platform=darwin_arm64 so hashes for all platforms are present.

All Terraform questions Roadmap: Terraform

More on IaC and Terraform Fundamentals