# 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

**Code:** `Moved object still exists` · **Category:** Terraform · **Seen on:** Terraform

A `moved` block points at an address that is still present in the configuration.

## 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?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/terraform/moved-object-still-exists)
