Question 760
At Yellowcrest Data Platforms, an authorized infrastructure engineering team manages a Terraform 1.12 and HCP Terraform environment. The team encounters the following situation: a root module declares var.region but a child module assumes it automatically inherits the value. Choose the technically best Terraform Associate 004 practice response to this particular infrastructure case. Which operational control addresses the risk long term?
Explanation
Correct Answer
Document required child module inputs clearly. This control addresses child module input variable scope because terraform module variable namespaces are isolated and inputs are passed through the call interface. The original implementation remedy remains: Declare the variable in the child and pass region explicitly in the module call.
Incorrect Answers
“Keep reusable modules' output contracts stable and minimal” addresses a different recurring failure: Child module resources are encapsulated and outputs form their public interface. For the condition in this question, maintain “Document required child module inputs clearly” because terraform module variable namespaces are isolated and inputs are passed through the call interface.
That review protects the control associated with: Module source locations may need to identify a nested package directory. It does not directly prevent the stated recurrence, which concerns: Terraform module variable namespaces are isolated and inputs are passed through the call interface. The appropriate guardrail is “Document required child module inputs clearly”.
“Keep allowed environment names in a reviewed validation rule” addresses a different recurring failure: Custom variable conditions fail early when a caller supplies disallowed values. For the condition in this question, maintain “Document required child module inputs clearly” because terraform module variable namespaces are isolated and inputs are passed through the call interface.