Question 320
At Junipercrest Logistics Networks, an authorized infrastructure engineering team manages a Terraform 1.12 and HCP Terraform environment. The team encounters the following situation: a consumer passes a string where a child module expects a structured object variable. 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
Publish and test module input schemas alongside code. This control addresses validate module input types because module variable type constraints define the shape accepted by module calls. The original implementation remedy remains: Correct the caller to provide the declared object type and validate.
Incorrect Answers
That review protects the control associated with: Static validation does not guarantee remote service capacity or authorization. It does not directly prevent the stated recurrence, which concerns: Module variable type constraints define the shape accepted by module calls. The appropriate guardrail is “Publish and test module input schemas alongside code”.
“Teach reviewers to distinguish computed unknowns from missing configuration” addresses a different recurring failure: Some resource values cannot be known until remote creation occurs. For the condition in this question, maintain “Publish and test module input schemas alongside code” because module variable type constraints define the shape accepted by module calls.
That review protects the control associated with: Provider schema and default changes can alter planned behavior across versions. It does not directly prevent the stated recurrence, which concerns: Module variable type constraints define the shape accepted by module calls. The appropriate guardrail is “Publish and test module input schemas alongside code”.