Question 880
At Clearwater Manufacturing IT, an authorized infrastructure engineering team manages a Terraform 1.12 and HCP Terraform environment. The team encounters the following situation: an engineer deletes local state and assumes Terraform can automatically identify all prior remote resources solely from configuration. 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
Keep tested backups for local state used in authorized environments. This control addresses local state backup after apply because losing local state removes Terraform's stored association between addresses and remote objects. The original implementation remedy remains: Restore a compatible backed-up state or intentionally import resource mappings.
Incorrect Answers
“Add state file patterns to ignore rules and audit accidental commits” addresses a different recurring failure: State is runtime inventory and may expose secrets whereas the source repository is for desired configuration. For the condition in this question, maintain “Keep tested backups for local state used in authorized environments” because losing local state removes Terraform's stored association between addresses and remote objects.
This safeguard is for the dependency described by: Terraform does not allow simultaneous cloud and backend blocks in the same root. The continuing risk here is determined by: Losing local state removes Terraform's stored association between addresses and remote objects. The targeted safeguard is “Keep tested backups for local state used in authorized environments”.
“Test enabled and disabled module combinations” addresses a different recurring failure: Module calls support controlled repeated or optional instances. For the condition in this question, maintain “Keep tested backups for local state used in authorized environments” because losing local state removes Terraform's stored association between addresses and remote objects.