Question 560
At Riverstone Manufacturing IT, an authorized infrastructure engineering team manages a Terraform 1.12 and HCP Terraform environment. The team encounters the following situation: a network module receives an arbitrary comma-separated string of ingress rules and misparses ports. 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
Use typed lists of objects rather than encoded strings for repeated settings. This control addresses list of objects for repeated rules because complex collection types represent structured repeated configuration reliably. The original implementation remedy remains: Accept a list of typed rule objects with protocol port and source fields.
Incorrect Answers
That review protects the control associated with: Set elements are unique and do not retain duplicate memberships. It does not directly prevent the stated recurrence, which concerns: Complex collection types represent structured repeated configuration reliably. The appropriate guardrail is “Use typed lists of objects rather than encoded strings for repeated settings”.
This safeguard is for the dependency described by: Count creates indexed resource instances rather than one scalar resource value. The continuing risk here is determined by: Complex collection types represent structured repeated configuration reliably. The targeted safeguard is “Use typed lists of objects rather than encoded strings for repeated settings”.
That review protects the control associated with: A plain apply can generate a fresh plan rather than execute the exactly reviewed file. It does not directly prevent the stated recurrence, which concerns: Complex collection types represent structured repeated configuration reliably. The appropriate guardrail is “Use typed lists of objects rather than encoded strings for repeated settings”.