Question 90
A Terraform associate evaluates: A migration requires updating provider selections in a controlled branch rather than during production apply. Select TWO complementary responses: the appropriate action AND direct evidence it worked.
Explanation
Correct Answers
The observed situation is: A migration requires updating provider selections in a controlled branch rather than during production apply. The acceptance evidence is: The lock-file diff shows a permitted upgrade and regression tests check provider behavior before apply. It verifies the corrective approach (Run terraform init -upgrade when intentionally reconsidering provider selections within configured constraints, then review lock-file and plan changes.) and controls the risk: Assuming ordinary init always picks the latest permitted provider can overlook existing lock selections. Checking an unrelated Terraform setting would not prove the stated requirement was met.
The case says: A migration requires updating provider selections in a controlled branch rather than during production apply. The directly relevant Terraform response is: Run terraform init -upgrade when intentionally reconsidering provider selections within configured constraints, then review lock-file and plan changes. This addresses the related failure mode: Assuming ordinary init always picks the latest permitted provider can overlook existing lock selections. Validate the result by checking: The lock-file diff shows a permitted upgrade and regression tests check provider behavior before apply. The selection matches this objective, rather than a different Terraform administration task.
Incorrect Answers
A clean init uses the committed selected provider version and verifies recorded package checksums. This belongs to Provider dependency lock file (official objective 2a). Its separate risk is that ignoring the provider lock file can unexpectedly select different compatible releases on different workstations. The question instead tests Deliberate provider version upgrades; that other safeguard alone does not verify it.
Declare provider source addresses and compatible version constraints under required_providers before initializing. That addresses Required provider constraints (official objective 2a), specifically the hazard that unbounded or incorrect provider version choices can cause inconsistent behavior or incompatible schemas. Here the necessary action or evidence is the paired action The lock-file diff shows a permitted upgrade and regression tests check provider behavior before apply and separate validation Run terraform init -upgrade when intentionally reconsidering provider selections within configured constraints, then review lock-file and plan changes, not that separate control.
A resource without its intended provider instance may target the default region or account unexpectedly. This addresses Provider configuration and aliases (official objective 2b). The separate hazard is that a resource without its intended provider instance may target the default region or account unexpectedly. It does not by itself satisfy the case-specific requirement for Deliberate provider version upgrades.