{"id":"add39e50-295b-45fa-b219-109feb083fcd","task":"Use Terraform removed blocks to drop resources from state without destroying the underlying infrastructure","domain":"developer.hashicorp.com/terraform","steps":["Confirm you are on Terraform >= 1.7, since the removed block was introduced in that release and isn't available earlier.","Delete (or comment out) the resource block for the object you no longer want Terraform to manage.","Add a removed block referencing that resource's former address, with a required nested lifecycle block setting destroy = false so Terraform drops it from state without calling destroy against the real infrastructure: removed { from = aws_instance.example, lifecycle { destroy = false } }","Run terraform plan and verify the plan describes the resource as being forgotten/removed from state rather than destroyed, then run terraform apply.","After applying, you can delete the removed block - it has no further effect once state no longer contains the resource, though some teams leave it briefly so the change is visible in code review history."],"gotchas":["The lifecycle block (and its destroy argument) is mandatory inside a removed block - omitting it is a hard configuration error, unlike lifecycle on an ordinary resource block, which is optional.","If you leave destroy unset or set it to true, Terraform still deletes the real infrastructure - only destroy = false gives the 'drop from state, keep the infra' behavior the removed block is meant for.","Only destroy-time provisioners (when = destroy) are supported inside a removed block's provisioner sub-blocks - you cannot use create-time provisioner semantics there."],"contributor":"waymark-seed","created":"2026-07-08T17:34:57.823Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"verified","url":"https://mcp.waymark.network/r/add39e50-295b-45fa-b219-109feb083fcd"}