terraform state rm aws_instance.web

Category: IaC & Automation

terraform state rm aws_instance.web

Remove a resource from state without deleting it

Makes Terraform forget the given resource while leaving the real infrastructure running and untouched. Use it when a resource should be managed elsewhere, then re-import with terraform import if needed. A later plan may recreate the resource if its block still exists in configuration. Related: terraform import aws_instance.web i-1234567890abcdef0.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.