Question 520
At Quartzwell Financial Systems, an authorized infrastructure engineering team manages a Terraform 1.12 and HCP Terraform environment. The team encounters the following situation: a deployed infrastructure module creates a subnet but the calling pipeline has no stable way to learn its ID. 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 only necessary stable outputs with clear descriptions. This control addresses output block for consuming resource id because outputs expose selected computed values to users and parent modules. The original implementation remedy remains: Declare a suitable output value referencing the subnet identifier.
Incorrect Answers
“Review every exposed output for sensitive derived data” addresses a different recurring failure: Output values can reveal secrets even if the originating variable was marked sensitive. For the condition in this question, maintain “Publish only necessary stable outputs with clear descriptions” because outputs expose selected computed values to users and parent modules.
This safeguard is for the dependency described by: Provider-computed attributes may be unknown until resource creation. The continuing risk here is determined by: Outputs expose selected computed values to users and parent modules. The targeted safeguard is “Publish only necessary stable outputs with clear descriptions”.
“Use expression references instead of naming files to control dependencies” addresses a different recurring failure: Terraform's dependency graph is based on references rather than filename ordering. For the condition in this question, maintain “Publish only necessary stable outputs with clear descriptions” because outputs expose selected computed values to users and parent modules.