TA-002-P · Question #405
What does Terraform use .terraform.lock.hcl file for?
The correct answer is A. Tracking provider dependencies. The .terraform.lock.hcl file is the dependency lock file introduced in Terraform 0.14. It records the exact provider versions and their checksums that were selected during terraform init. This ensures all team members and CI/CD pipelines use identical provider versions…
Question
What does Terraform use .terraform.lock.hcl file for?
Options
- ATracking provider dependencies
- BThere is no such file
- CPreventing Terraform runs from occurring
- DStoring references to workspaces which are locked
How the community answered
(31 responses)- A87% (27)
- B3% (1)
- C6% (2)
- D3% (1)
Explanation
The .terraform.lock.hcl file is the dependency lock file introduced in Terraform 0.14. It records the exact provider versions and their checksums that were selected during terraform init. This ensures all team members and CI/CD pipelines use identical provider versions, preventing unexpected behavior from automatic upgrades. It should be committed to version control. It has nothing to do with workspace locking or preventing runs. Answer A is correct.
Topics
Community Discussion
No community discussion yet for this question.