terraform-aws-modules / terraform-aws-autoscaling

Terraform module to create AWS Auto Scaling resources 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/autoscaling/aws
Apache License 2.0
289 stars 553 forks source link

Override create_before_destroy for ASG #190

Closed brahama closed 2 years ago

brahama commented 2 years ago

Hi!

I was checking how it would be possible to override the ASG lifecycle that was introduced in issue #33 for use cases where i need the instance to be terminated before it is replaced.

Thanks!

antonbabenko commented 2 years ago

Hi!

It is not possible to parametrize values in lifecycle in Terraform.

If you want to terminate all instances, you should set desired_capacity = 0 and wait for some time before making other changes. Such a use case requires multiple steps execution of terraform apply to orchestrate the process.

There is nothing we can do in this module.

brahama commented 2 years ago

Got it! Yes right now what im doing is removed the refresh block and just terminate the instance after the apply.

Thanks!

github-actions[bot] commented 1 year ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.