Question 340
At Kestrelview Education Services, an authorized infrastructure engineering team manages a Terraform 1.12 and HCP Terraform environment. The team encounters the following situation: a CI job assumes any zero exit from terraform plan means a change is pending. 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
Write pipeline logic for all detailed-exit-code outcomes. This control addresses plan exit code automation because the detailed exit-code flag distinguishes no-op plans from planned differences and failures. The original implementation remedy remains: Use terraform plan -detailed-exitcode and interpret zero as no change two as changes and one as error.
Incorrect Answers
“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 “Write pipeline logic for all detailed-exit-code outcomes” because the detailed exit-code flag distinguishes no-op plans from planned differences and failures.
That review protects the control associated with: Terraform initialization installs newly required provider dependencies. It does not directly prevent the stated recurrence, which concerns: The detailed exit-code flag distinguishes no-op plans from planned differences and failures. The appropriate guardrail is “Write pipeline logic for all detailed-exit-code outcomes”.
“Require handoff protocols for ownership transitions” addresses a different recurring failure: Removing an address from Terraform management should be distinct from deleting the remote object. For the condition in this question, maintain “Write pipeline logic for all detailed-exit-code outcomes” because the detailed exit-code flag distinguishes no-op plans from planned differences and failures.