Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Working terraform destroy
will tear down the entire stack related to some terraform code.
Nonetheless, generally you may solely need to take away a particular piece of your infrastructure.
To do that, you should use the terraform destroy -target
object.
Get a listing of all of the assets from the state:
terraform state listing
#information.aws_ami.webserver_ami
#aws_autoscaling_group.asg-web[0]
#random_string.rand3
#...
Run a terraform destroy -target
and go a useful resource from the state listing
above:
terraform destroy -target aws_autoscaling_group.asg-web[0] -auto-approve
We additionally added a -auto-approve
within the above command to routinely delete the useful resource with out prompting us for affirmation.