Destroy the specific ECS service

hy ! I have 7 ECS services .Each service have there state file in s3 bucket. Now i want to destroy 1 of service. In state file there are many resources should i use terraform destroy or terraform destroy -target specific resource. because state file has some resource which is connect to other services also. pls recommend me the solution

Hi @talhaSl,

The usual way to destroy a single object with Terraform is to remove it from the configuration and then run terraform apply.

The terraform destroy command is for destroying the entire set of infrastructure, and is typically used only for development environments where it’s useful to be able to destroy everything and then recreate when trying different strategies.

1 Like