Question 480
A Terraform associate evaluates: Two module instances provide separate outputs that must remain associated with their call labels. Select TWO complementary responses: the appropriate action AND direct evidence it worked.
Explanation
Correct Answers
The case says: Two module instances provide separate outputs that must remain associated with their call labels. The directly relevant Terraform response is: Expose child module outputs explicitly, and access them through module.NAME.OUTPUT rather than private internal symbols. This addresses the related failure mode: Directly referencing a child's local or resource name from the parent violates module encapsulation and may fail validation. Validate the result by checking: An output declared in the child resolves for the parent and is passed to a sibling module correctly. The selection matches this objective, rather than a different Terraform administration task.
The observed situation is: Two module instances provide separate outputs that must remain associated with their call labels. The acceptance evidence is: An output declared in the child resolves for the parent and is passed to a sibling module correctly. It verifies the corrective approach (Expose child module outputs explicitly, and access them through module.NAME.OUTPUT rather than private internal symbols.) and controls the risk: Directly referencing a child's local or resource name from the parent violates module encapsulation and may fail validation. Checking an unrelated Terraform setting would not prove the stated requirement was met.
Incorrect Answers
After the reviewed upgrade, module contents and plan correspond to the intended remote version. This belongs to Refresh installed module code after source updates (official objective 5d). Its separate risk is that a cached downloaded module may not reflect a new selected registry release or revised source until reinitialized. The question instead tests Parent scope and module output boundaries; that other safeguard alone does not verify it.
Declare child module inputs inside the child and pass values through module block arguments from the parent; do not assume root variables magically populate children. That addresses Child module input variable scope (official objective 5b), specifically the hazard that a child module that references an undeclared input variable cannot access a similarly named root variable automatically. Here the necessary action or evidence is the paired action Expose child module outputs explicitly, and access them through module.NAME.OUTPUT rather than private internal symbols and separate validation An output declared in the child resolves for the parent and is passed to a sibling module correctly, not that separate control.
Consuming a mutable remote branch without an intended ref can change module behavior unexpectedly. This does not provide the required Parent scope and module output boundaries action-and-evidence pair.