Terraform - Don't wait for autoscaling group destroy

2.3k Views Asked by At

When using the Terraform lifecycle to manage our autoscaling groups, we are using the create_before_destroy flag so that our new autoscaling group (ASG) is created before destroying the current ASG. The issue I'm trying to solve is that it seems to take up to 10 mins for Terraform to destroy the current ASG.

enter image description here

Is there a way to start the destroy command and not wait for it to complete?

1

There are 1 best solutions below

0
On

When destroying an autoscaling group terraform by default will wait for all instances in the pool to terminate. You can force an autoscaling group to delete even if it's in the process of scaling a resource. This is not the default behaviour, Terraform will normally drain all the instances before deleting the group. You can bypass this by specifying force_delete on the ASG but it could leave orphaned resources which is the reason for the default behaviour.