# Error: Resource instance has been removed from the configuration but is still tracked in the state

- **ID:** `terraform/resource-in-config-no-longer-exists`
- **Domain:** terraform
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A resource was removed from the .tf configuration file but Terraform still has it in the state, causing a plan to destroy it unexpectedly.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Terraform v1.5.0 | active | — | — |
| Terraform v1.6.0 | active | — | — |
| Terraform v1.7.0 | active | — | — |

## Workarounds

1. **Run 'terraform state rm <resource_address>' to remove the resource from state without destroying it, then run 'terraform apply' to sync.** (95% success)
   ```
   Run 'terraform state rm <resource_address>' to remove the resource from state without destroying it, then run 'terraform apply' to sync.
   ```
2. **If you want to destroy the resource, run 'terraform apply' directly after verifying the plan shows the intended destroy.** (90% success)
   ```
   If you want to destroy the resource, run 'terraform apply' directly after verifying the plan shows the intended destroy.
   ```
3. **Use 'terraform state list' to identify the full resource address, then 'terraform state rm <address>'.** (85% success)
   ```
   Use 'terraform state list' to identify the full resource address, then 'terraform state rm <address>'.
   ```

## Dead Ends

- **** — The apply will execute the destroy, removing the resource permanently. (90% fail)
- **** — Manual edits often break state file format or leave orphaned dependencies. (80% fail)
- **** — Terraform will try to create a new resource, conflicting with the existing state entry. (70% fail)
