nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-004 · Question #142

What does Terraform use the .terraform.lock.hc1 file for?

The correct answer is B. Tracking specific provider dependencies. The .terraform.lock.hcl file is a new feature in Terraform 0.14 that records the exact versions of each provider used in your configuration. This helps ensure consistent and reproducible behavior across different machines and runs.

Submitted by ahmad_uae· Apr 18, 2026Understand Terraform Providers

Question

What does Terraform use the .terraform.lock.hc1 file for?

Options

  • AThere is no such file
  • BTracking specific provider dependencies
  • CPreventing Terraform runs from occurring
  • DStoring references to workspaces which are locked

How the community answered

(65 responses)
  • A
    2% (1)
  • B
    92% (60)
  • C
    5% (3)
  • D
    2% (1)

Explanation

The .terraform.lock.hcl file is a new feature in Terraform 0.14 that records the exact versions of each provider used in your configuration. This helps ensure consistent and reproducible behavior across different machines and runs.

Topics

#Provider Dependencies#Version Locking#terraform init

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-004 Practice