If you need to delete all resources created by Terraform, except for a single, specific one, then you can do the following:

Step 1 – Get the current state list

1
terraform state list

Step 2 – Remove the exception resource

Remove the specific resource that you don’t want Terraform to track anymore.

1
terraform state rm <resource_to_be_removed>

Step 3 – Destroy the resources

1
terraform destroy