2

In terraform, to reduce downtime when creating a new auto-scaling-group behind an existing load balancer, you can use a launch configuration and set create-before-destroy.

Launch templates are the recommended/new replacement for launch configs... but I can't seem to figure out how to achieve the same thing.

How can you mimmic this behavior in launch templates?

1 Answer 1

4

It seems you're misunderstanding what the create-before-destroy lifecycle parameter of the launch configuration does.
It's about replacing the launch configuration within an autoscaling group, not replacing the autoscaling group.

Launch templates have versions which makes this parameter useless as you'll create a new version of the launch template before updating the ASG to use it.

Terraform gives an example in the ASG documentation.

The underlying idea is to be able to roll back more easily than with launch-configurations.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.