Preparing Practice Exam…
Please wait a moment while the system generates the exam questions, answers, and study session.
Please wait a moment while the system generates the exam questions, answers, and study session.
Question 8 of 112
Free Preview · 112 of 371 · questions 1–112 of 371 are free. Sign up free to sync your progress across devices.
Select one answer.
Written by other learners. Comments can disagree with the marked answer — check the official documentation when in doubt.
B. Terraform will use the version recorded in your lock file. ✅ Here’s why: The .terraform.lock.hcl file locks provider versions for your working directory. This ensures consistent behavior across runs, so Terraform uses the same provider version for all resources, even when you add new resources. The version constraint in your configuration (required_providers) defines which versions are allowed, but Terraform will prioritize the version in the lock file if it satisfies the constraint. Terraform does not check the state file to pick a provider version—the state only tracks infrastructure resources. It does not automatically use the latest provider version unless you explicitly run terraform init -upgrade and the new version satisfies the constraints.