Question 770
At Zenithpark Cloud Operations, an authorized infrastructure engineering team manages a Terraform 1.12 and HCP Terraform environment. The team encounters the following situation: a module creates a service URL but the root needs it for a DNS record and cannot reference the nested resource directly. Choose the technically best Terraform Associate 004 practice response to this particular infrastructure case. What mechanism explains why the original approach fails?
Explanation
Correct Answer
Child module resources are encapsulated and outputs form their public interface. That mechanism distinguishes module output propagation to root in the Zenithpark Cloud Operations case. The corresponding appropriate correction is: Expose an output from the child and use module.service.url in the root. The measurable acceptance test is: The DNS record receives the module's actual service URL.
Incorrect Answers
“Variables configure ordinary module data while provider mappings select API identity and context” reflects the mechanism: Variables configure ordinary module data while provider mappings select API identity and context. The actual reported symptoms are better explained by: Child module resources are encapsulated and outputs form their public interface.
The offered principle describes: Module source code changes can change the resulting resource graph even with unchanged caller variables. The situation in this question instead depends on: Child module resources are encapsulated and outputs form their public interface. These are different technical conditions.
This alternative is valid when the local backend can store its state in a specified local file path. The facts here establish a different controlling reason: Child module resources are encapsulated and outputs form their public interface.