Question 450
A Terraform associate evaluates: A project needs a repeatable way to reuse a small child module from the same repository. Select TWO complementary responses: the appropriate action AND direct evidence it worked.
Explanation
Correct Answers
The case says: A project needs a repeatable way to reuse a small child module from the same repository. The directly relevant Terraform response is: Use an explicit local filesystem path in a module source to reuse checked-in configuration from a child directory. This addresses the related failure mode: A nonexistent local module path prevents init from loading the module, and a module name is not itself a source path. Validate the result by checking: The module resolves from the intended repository subdirectory and resources are addressed under module.NAME. The selection matches this objective, rather than a different Terraform administration task.
The observed situation is: A project needs a repeatable way to reuse a small child module from the same repository. The acceptance evidence is: The module resolves from the intended repository subdirectory and resources are addressed under module.NAME. It verifies the corrective approach (Use an explicit local filesystem path in a module source to reuse checked-in configuration from a child directory.) and controls the risk: A nonexistent local module path prevents init from loading the module, and a module name is not itself a source path. Checking an unrelated Terraform setting would not prove the stated requirement was met.
Incorrect Answers
Directly referencing a child's local or resource name from the parent violates module encapsulation and may fail validation. That is the exact risk associated with Parent scope and module output boundaries (official objective 5b), not the required Local module source paths outcome.
Use a valid Git or registry module source and pin a ref or compatible module version where the source type supports it. This addresses Remote module sources and pinning (official objective 5a). The separate hazard is that consuming a mutable remote branch without an intended ref can change module behavior unexpectedly. It does not by itself satisfy the case-specific requirement for Local module source paths.
An init downloads a compatible explicitly selected module version and the change is visible in review. This does not provide the required Local module source paths action-and-evidence pair.