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.
More on IaC and Terraform Fundamentals
What is Infrastructure as Code and why do teams use it?BeginnerWhat is the difference between declarative and imperative infrastructure tools?BeginnerWhat is Terraform and what problem does it solve?BeginnerWhat is HCL and can Terraform use anything else?BeginnerWhich files make up a typical Terraform root module?BeginnerHow does Terraform work internally?Advanced