0
votes

I have been able to deploy AWS Auto Scaling group, load balancer, security group and EC2 instances using terraform apply.

Now, I want to destroy the infrastructure using command terraform destroy, but it gives Destroy cancelled.

I do not wish to destroy the resources manually from AWS Management Console but via terraform commands only.

2
Full error message (and at least a couple of lines of output) would be useful.Adam Byrtek

2 Answers

0
votes

I tried to forcefully destroy the deployed infrastructure using command terraform destroy -force, and it worked just fine

0
votes

The message "Destroy cancelled." is returned if you don't type the string "yes" at the confirmation prompt:

Terraform will delete all your managed infrastructure.
There is no undo. Only 'yes' will be accepted to confirm.

Do you really want to destroy?

Terraform requires typing yes as a safety measure. If you're running Terraform in a non-interactive way it may not be possible to enter this response, so the -force option provides a way to confirm via the command prompt.