When i run terraform apply it creates a droplet on digitalOcean, and soon as it creates, i I am removing the terrafrom.tfstate file and all the file that created after droplet luanch. and i am saving that info in a database.
Now i want to delete certain resource by its resource id or urn or uuid. is it possible?
I am saving these info in database.
>Solution :
Instead of removing the tf state, you should just copy it to the database
Then to remove a specific resource
terraform destroy -target TYPE.NAME
In your case
terraform destroy -target digitalocean_droplet.web
