Question 460
At Oakcrest Health Research, an authorized infrastructure engineering team manages a Terraform 1.12 and HCP Terraform environment. The team encounters the following situation: a project asks Terraform to create its first monitoring alarm but defines only a data source query for an alarm that is not present. 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
Check required lifecycle ownership before writing Terraform blocks. This control addresses create new object rather than data query because a data source cannot create an object that does not already exist. The original implementation remedy remains: Declare a supported managed alarm resource and configure its desired attributes.
Incorrect Answers
“Define shared-resource lookup contracts and key ownership” addresses a different recurring failure: Existing shared encryption infrastructure should not be duplicated by consumers needing only its identifier. For the condition in this question, maintain “Check required lifecycle ownership before writing Terraform blocks” because a data source cannot create an object that does not already exist.
That review protects the control associated with: The sensitive marker suppresses routine UI output but ordinarily does not prevent state persistence. It does not directly prevent the stated recurrence, which concerns: A data source cannot create an object that does not already exist. The appropriate guardrail is “Check required lifecycle ownership before writing Terraform blocks”.
This safeguard is for the dependency described by: Remote workers receive workspace configuration rather than arbitrary developer-local shell variables. The continuing risk here is determined by: A data source cannot create an object that does not already exist. The targeted safeguard is “Check required lifecycle ownership before writing Terraform blocks”.