Question 70
A Terraform associate evaluates: A plan fails because one dependency requires a provider version outside the root constraints. Select TWO complementary responses: the appropriate action AND direct evidence it worked.
Explanation
Correct Answers
The case says: A plan fails because one dependency requires a provider version outside the root constraints. The directly relevant Terraform response is: Declare provider source addresses and compatible version constraints under required_providers before initializing. This addresses the related failure mode: Unbounded or incorrect provider version choices can cause inconsistent behavior or incompatible schemas. Validate the result by checking: terraform init resolves a provider release that satisfies declared constraints and the lock file documents the selection. The selection matches this objective, rather than a different Terraform administration task.
The observed situation is: A plan fails because one dependency requires a provider version outside the root constraints. The acceptance evidence is: terraform init resolves a provider release that satisfies declared constraints and the lock file documents the selection. It verifies the corrective approach (Declare provider source addresses and compatible version constraints under required_providers before initializing.) and controls the risk: Unbounded or incorrect provider version choices can cause inconsistent behavior or incompatible schemas. Checking an unrelated Terraform setting would not prove the stated requirement was met.
Incorrect Answers
The lock-file diff shows a permitted upgrade and regression tests check provider behavior before apply. 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 Declare provider source addresses and compatible version constraints under required_providers before initializing and separate validation terraform init resolves a provider release that satisfies declared constraints and the lock file documents the selection, not that separate control.
Deleting or editing state without understanding bindings can orphan real resources or produce unwanted create plans. This addresses State resource bindings (official objective 2d). The separate hazard is that deleting or editing state without understanding bindings can orphan real resources or produce unwanted create plans. It does not by itself satisfy the case-specific requirement for Required provider constraints.
Commit the generated.terraform.lock.hcl dependency lock file to version control to keep provider selections and checksums consistent. This does not provide the required Required provider constraints action-and-evidence pair.