Skip to main content
RunBook Academy

← All break/fix scenarios in Terraform

advancedterraform-state~30 min

moved Block Maps Resources in Wrong Direction

Reported symptoms

  • A moved block was applied
  • The state now points to wrong resources
  • The apply destroys the wrong resources

Evidence

  • · The moved block content
  • · The state addresses
  • · The real-world resources
Diagnosis and resolutionclick to reveal

Root cause

A moved block maps the from address to the to address. If the from and to are reversed, the state binds the wrong resources. The apply destroys the resources the state now points to.

Remediation

1. Do not apply. 2. Identify the wrong binding. 3. Reverse the moved block. 4. Re-plan. 5. Verify the plan is empty.

Verification

The resources are correctly bound, the plan is empty, and the incident is documented.

Prevention

1. Test moved blocks in development. 2. Use terraform plan to verify the state binding. 3. Review the moved block direction.

moved Block Maps Resources in Wrong Direction

A moved block maps the from address to the to address. If the from and to are reversed, the state binds the wrong resources. The apply destroys the resources the state now points to.