gotchaMajorpending
Terraform plan shows no changes but apply fails
Viewed 0 times
state driftterraform refreshterraform importout-of-band changesstate file
terraformawsterminal
Error Messages
Problem
terraform plan shows 'No changes. Your infrastructure matches the configuration.' but terraform apply fails, or the actual infrastructure does not match what Terraform thinks it is.
Solution
State drift: someone changed infrastructure outside Terraform (console, CLI, another tool). Fix: (1) terraform refresh to sync state with reality (deprecated in 1.x, use terraform apply -refresh-only). (2) terraform import to bring manually created resources into state. (3) terraform state rm to remove resources that no longer exist. Prevention: lock down manual access, use CI/CD for all changes, enable drift detection.
Why
Terraform trusts its state file as the source of truth. If infrastructure changes outside Terraform, the state file becomes stale and plan/apply decisions are based on incorrect assumptions.
Revisions (0)
No revisions yet.