HashiCorp Terraform Associate Practice Exam

Access More Questions
What is the purpose of the .terraform.lock.hcl file?
Correct Answer:
Tracking provider dependencies
Explanation:
The file serves to lock provider versions so runs are reproducible. It records which providers your configuration uses, the exact versions that were resolved, their sources, and a checksum for each provider binary. When you run Terraform init again, Terraform reads this lock file and installs the same provider versions, ensuring consistent behavior across machines and environments. This prevents unexpected upgrades from happening just because new provider versions exist. The lock file is generated and updated by Terraform and is about locking provider dependencies, not about blocking runs or storing workspace data.

Access more questions from this quiz

Continue to HashiCorp Terraform Associate Practice Exam for more practice questions and the full quiz experience.

Access More Questions