Destroy specific Node in terraform

Hi Team,
Currently we are using Terraform to create servers.
One of requirement is to delete a specific server from terraform.
Kindly provide any possibility with terraform.

Thanks in advance,
Sharath Mankala

Hi Sharath,

Yes, terraform can destroy a specific resource using the -target flag.

Example: terraform destroy -target RESOURCE_TYPE.NAME

Reference link:

Hi Ravi,
root@smankala:~/teraform/staging# terraform state list


above is my terraform state.
i want to delete sever with specific IP.
is their any possibulity.
Thanks in Advance.

You can find the IP if you download the state file.
terraform state pull > state.json

Then look at the state.json file, and you should be able to determine which of the 0/1 state resources is the one you want to delete