Question 80
A Terraform associate evaluates: A deployment should not drift to a newly released provider during a routine rebuild. Select TWO complementary responses: the appropriate action AND direct evidence it worked.
Explanation
Correct Answers
The case says: A deployment should not drift to a newly released provider during a routine rebuild. The directly relevant Terraform response is: Commit the generated .terraform.lock.hcl dependency lock file to version control to keep provider selections and checksums consistent. This addresses the related failure mode: Ignoring the provider lock file can unexpectedly select different compatible releases on different workstations. Validate the result by checking: A clean init uses the committed selected provider version and verifies recorded package checksums. The selection matches this objective, rather than a different Terraform administration task.
The observed situation is: A deployment should not drift to a newly released provider during a routine rebuild. The acceptance evidence is: A clean init uses the committed selected provider version and verifies recorded package checksums. It verifies the corrective approach (Commit the generated .terraform.lock.hcl dependency lock file to version control to keep provider selections and checksums consistent.) and controls the risk: Ignoring the provider lock file can unexpectedly select different compatible releases on different workstations. Checking an unrelated Terraform setting would not prove the stated requirement was met.
Incorrect Answers
A resource without its intended provider instance may target the default region or account unexpectedly. This is relevant to Provider configuration and aliases (official objective 2b). Its distinct failure risk is that a resource without its intended provider instance may target the default region or account unexpectedly. The present question tests Provider dependency lock file, which this measure alone does not establish.
Run terraform init -upgrade when intentionally reconsidering provider selections within configured constraints, then review lock-file and plan changes. That addresses Deliberate provider version upgrades (official objective 2a), specifically the hazard that assuming ordinary init always picks the latest permitted provider can overlook existing lock selections. Here the necessary action or evidence is the paired action Commit the generated.terraform.lock.hcl dependency lock file to version control to keep provider selections and checksums consistent and separate validation A clean init uses the committed selected provider version and verifies recorded package checksums, not that separate control.
terraform init resolves a provider release that satisfies declared constraints and the lock file documents the selection. This addresses Required provider constraints (official objective 2a). The separate hazard is that unbounded or incorrect provider version choices can cause inconsistent behavior or incompatible schemas. It does not by itself satisfy the case-specific requirement for Provider dependency lock file.