Moved object still exists Terraform Origin: Platform & cloud OSI layer 7 · Application Last updated 5 Nov 2026

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.

Exact message you may see 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
Seen on: Terraform

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 from address

⚡ Quick fix

  1. Delete the old resource block after renaming
  2. Fix from/to addresses
  3. Run terraform plan to verify "has moved" actions

Detailed fix by platform

Terraform

  1. terraform plan # shows "aws_x.old has moved to aws_x.new"

How to diagnose

  1. Old — Still declared?
  2. Addresses — Correct?
  3. 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:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

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 (Terraform)Cannot import non-exi…Error building ARM Config: obtain subscription from Azure CLI — Terraform: Error: building AzureRM Client: obtaining subscription ID / Please run 'az login' to setup account (Terraform)Error building ARM Co…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 (Terraform)Instance cannot be de…Invalid AWS Region — Terraform: Error: Invalid AWS Region: us-east-3 / Error: configuring Terraform AWS Provider: validating provider credentials: operation error STS: GetCallerIdentity (Terraform)Invalid AWS RegionNo valid credential sources found (AWS provider) — Terraform: Error: No valid credential sources found — failed to refresh cached credentials, no EC2 IMDS role found / Error: configuring Terraform AWS Provider: no valid credential sources (Terraform)No valid credential s…Provider configuration not present (removed resource) — Terraform: Error: Provider configuration not present — its original provider configuration is required, but it has been removed (Terraform)Provider configuratio…Reference to undeclared resource — Terraform: Error: Reference to undeclared resource / Reference to undeclared input variable (Terraform)Reference to undeclar…UnauthorizedOperation / AccessDenied during Terraform apply — Terraform: Error: creating EC2 Instance: UnauthorizedOperation: You are not authorized to perform this operation. User: arn:aws:iam::123:user/ci is not authorized to perform: ec2:RunInstances (Terraform)UnauthorizedOperation…Moved obj…

Explore the map of this error Full error map →

🧠 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.