The .terraform.lock.hcl file tracks module versions.
The .terraform.lock.hcl file tracks module versions.
The .terraform.lock.hcl file is used to lock the versions of the provider dependencies used by your Terraform configuration. It does not track module versions. Module versions are typically tracked in the Terraform configuration files through version constraints.
The .terraform.lock.hcl file is not used to track module versions; it is used to lock the versions of the provider dependencies used by your Terraform configuration.
At present, the dependency lock file tracks only provider dependencies. Terraform does not remember version selections for remote modules, and so Terraform will always select the newest available module version that meets the specified version constraints. Fuente: https://developer.hashicorp.com/terraform/language/files/dependency-lock
At present, the dependency lock file tracks only provider dependencies. Terraform does not remember version selections for remote modules, and so Terraform will always select the newest available module version that meets the specified version constraints. You can use an exact version constraint to ensure that Terraform will always select the same module version. https://developer.hashicorp.com/terraform/language/files/dependency-lock
A The .terraform.lock.hcl file keeps track of the specific versions of modules used in your Terraform configuration. It records the exact versions of modules and their dependencies to ensure that subsequent runs of Terraform use the same versions consistently. This file helps maintain consistency across different environments and team members working on the same Terraform project by locking the versions of modules, preventing unintentional upgrades or changes to the modules without explicit action.
tracks both providers and modules versions
"At present, the dependency lock file tracks only provider dependencies. Terraform does not remember version selections for remote modules, and so Terraform will always select the newest available module version that meets the specified version constraints. " https://developer.hashicorp.com/terraform/language/files/dependency-lock
The .terraform.lock.hcl file does not track module versions. Instead, it is used to lock the versions of the provider plugins used by Terraform. It helps ensure that the same provider versions are used consistently across different Terraform runs and by different team members. Module versions, on the other hand, are typically tracked in the versions.tf or required_version block in the main Terraform configuration file or in the root module. The versions of modules are controlled through the Terraform configuration itself, not the .terraform.lock.hcl file.
https://developer.hashicorp.com/terraform/language/files/dependency-lock
At present, the dependency lock file tracks only provider dependencies. Terraform does not remember version selections for remote modules, and so Terraform will always select the newest available module version that meets the specified version constraints. You can use an exact version constraint to ensure that Terraform will always select the same module version.
In the newest documentation .terraform.lock.hcl tracks both modules and providers versions.
The question does not ask if it’s used to track only module version.. the dependency lock is used to track both provider and module version.. Hence I go with Option A
At present, the dependency lock file tracks only provider dependencies. Terraform does not remember version selections for remote modules https://developer.hashicorp.com/terraform/language/files/dependency-lock