nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-003 · Question #170

When does Terraform create the .terraform.lock.hc1 file?

The correct answer is C. After your first terraform init. Terraform creates the .terraform.lock.hcl file after the first terraform init command. This lock file ensures that the dependencies for your project are consistent across different runs by locking the versions of the providers and modules used.

Understand Terraform basics

Question

When does Terraform create the .terraform.lock.hc1 file?

Options

  • AAfter your first terraform plan
  • BAfter your first terraform apply
  • CAfter your first terraform init
  • DWhen you enable state locking

How the community answered

(16 responses)
  • A
    19% (3)
  • B
    6% (1)
  • C
    69% (11)
  • D
    6% (1)

Explanation

Terraform creates the .terraform.lock.hcl file after the first terraform init command. This lock file ensures that the dependencies for your project are consistent across different runs by locking the versions of the providers and modules used.

Topics

#dependency lock file#.terraform.lock.hcl#terraform init#provider versions

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-003 Practice