Detailed Explanation:
Rationale for Correct Answer (D):The terraform.lock.hcl file is automatically created and maintained by Terraform. It records the specific versions and checksums of providers used in a configuration, ensuring consistent runs across environments and machines.
Analysis of Incorrect Options:
A. There is no such file: Incorrect — the lock file exists and is crucial for dependency management.
B. Storing references to workspaces: Incorrect — workspaces are tracked in the state file, not the lock file.
C. Preventing Terraform runs: Incorrect — the lock file does not block runs; it enforces consistent provider versions.
Key Concept:The terraform.lock.hcl file enforces provider version consistency, which is critical for reproducible and reliable Terraform deployments.
[Reference:Terraform Exam Objective – Read, Generate, and Modify Configurations., , , ]
Submit