Terraform: Error: Moved object still exists — This statement declares a move from aws_x.old, but that resource instance is still declared at main.tf
A moved block points at an address that is still present in the configuration.
Error: Moved object still existsThis statement declares a move from aws_x.old, but that resource instance is still declared at main.tfError: Cycle in move statementsError: Invalid "moved" blockError: Unresolvable move statements Meaning
A moved { from = old to = new } is only valid when old is no longer declared. Remove the old resource block (renamed) or remove/adjust the moved block. Chains of moves are allowed; cyclic moves are not. After applying the move you may delete the moved block (keep for module consumers).
Common causes
- Old resource block still in config
- Renamed but copied instead of renamed
- Cyclic moved blocks
- Moved block in a module for a resource that exists
- Wrong
fromaddress
⚡ Quick fix
- Delete the old
resourceblock after renaming - Fix
from/toaddresses - Run
terraform planto verify "has moved" actions
Detailed fix by platform
Terraform
terraform plan # shows "aws_x.old has moved to aws_x.new"
How to diagnose
- Old — Still declared?
- Addresses — Correct?
- Chain — Cyclic?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- Cannot import non-existent remote object Terraform: Error: Cannot import non-existent remote object — While attempting to import an existing object to "aws_s3_bucket.logs", the provider detected that no object exists with the given id
- Error building ARM Config: obtain subscription from Azure CLI Terraform: Error: building AzureRM Client: obtaining subscription ID / Please run 'az login' to setup account
- Instance cannot be destroyed (lifecycle.prevent_destroy) Terraform: Error: Instance cannot be destroyed — Resource aws_db_instance.prod has lifecycle.prevent_destroy set, but the plan calls for this resource to be destroyed
Most viewed in Terraform
- Error acquiring the state lock Terraform: Error: Error acquiring the state lock — ConditionalCheckFailedException / state blob is already locked
- Inconsistent dependency lock file Terraform: Error: Inconsistent dependency lock file — provider x: required by this configuration but no version is selected
- Resource is tainted and must be replaced Terraform: # aws_instance.web is tainted, so must be replaced — -/+ destroy and then create replacement
Other ways to find it
Where this error sits
Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 5 Nov 2026