Question 940
At Elmriver Health Research, an authorized infrastructure engineering team manages a Terraform 1.12 and HCP Terraform environment. The team encounters the following situation: an engineer adds an object-store backend to a root with existing local state but fails to migrate its managed mapping. 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
Back up state and rehearse backend migration before production changes. This control addresses backend migration from local to remote because changing a backend does not automatically guarantee the previous local snapshot has been transferred. The original implementation remedy remains: Run terraform init -migrate-state after reviewing the target backend and backup.
Incorrect Answers
That review protects the control associated with: Backend initialization happens before normal input expression evaluation. It does not directly prevent the stated recurrence, which concerns: Changing a backend does not automatically guarantee the previous local snapshot has been transferred. The appropriate guardrail is “Back up state and rehearse backend migration before production changes”.
This safeguard is for the dependency described by: Resource address changes can be reflected in state without changing actual infrastructure. The continuing risk here is determined by: Changing a backend does not automatically guarantee the previous local snapshot has been transferred. The targeted safeguard is “Back up state and rehearse backend migration before production changes”.
“Publish only necessary stable outputs with clear descriptions” addresses a different recurring failure: Outputs expose selected computed values to users and parent modules. For the condition in this question, maintain “Back up state and rehearse backend migration before production changes” because changing a backend does not automatically guarantee the previous local snapshot has been transferred.