Question 120
A Terraform associate evaluates: A review catches a provider alias declared but never assigned to the planned secondary resource. Select TWO complementary responses: the appropriate action AND direct evidence it worked.
Explanation
Correct Answers
The case says: A review catches a provider alias declared but never assigned to the planned secondary resource. The directly relevant Terraform response is: Attach resources to the intended aliased provider instance using the resource provider meta-argument rather than relying on the default. This addresses the related failure mode: An omitted provider = alias reference can create infrastructure in the wrong region. Validate the result by checking: The plan associates the resource with the expected alias and the resulting object appears in the intended region. The selection matches this objective, rather than a different Terraform administration task.
The observed situation is: A review catches a provider alias declared but never assigned to the planned secondary resource. The acceptance evidence is: The plan associates the resource with the expected alias and the resulting object appears in the intended region. It verifies the corrective approach (Attach resources to the intended aliased provider instance using the resource provider meta-argument rather than relying on the default.) and controls the risk: An omitted provider = alias reference can create infrastructure in the wrong region. 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. This belongs to Deliberate provider version upgrades (official objective 2a). Its separate risk is that assuming ordinary init always picks the latest permitted provider can overlook existing lock selections. The question instead tests Explicit multi-region provider selection; that other safeguard alone does not verify it.
Terraform core alone does not know how to create every cloud resource without a supporting provider implementation. This is relevant to Provider plugin responsibilities (official objective 2b). Its distinct failure risk is that terraform core alone does not know how to create every cloud resource without a supporting provider implementation. The present question tests Explicit multi-region provider selection, which this measure alone does not establish.
Map the parent's intended provider configurations into a child module's providers argument and declare configuration aliases where required. That addresses Pass provider aliases to child modules (official objective 2c), specifically the hazard that assuming child modules automatically see every aliased provider may result in wrong bindings or validation failures. Here the necessary action or evidence is the paired action Attach resources to the intended aliased provider instance using the resource provider meta-argument rather than relying on the default and separate validation The plan associates the resource with the expected alias and the resulting object appears in the intended region, not that separate control.