<p>It seems you're misunderstanding what the create-before-destroy lifecycle parameter of the launch configuration does.<br />
It's about replacing the launch configuration within an autoscaling group, not replacing the autoscaling group.</p>
<p>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.</p>
<p>Terraform gives an example in the <a href="https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/autoscaling_group#with-latest-version-of-launch-template" rel="nofollow noreferrer">ASG documentation</a>.</p>
<p>The underlying idea is to be able to roll back more easily than with launch-configurations.</p>

CC BY-SA 4.0
2022-05-13T15:17:44.870Z
The terraform docs link has changed, it's here currently: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/autoscaling_group#with-latest-version-of-launch-template
Andrew Davison
CC BY-SA 4.0
2022-05-13T22:10:31.723Z
Feel free to edit :)
Tensibai
CC BY-SA 4.0
2020-02-20T08:41:58.490Z
2022-05-17T13:52:49.357Z
2022-05-17T13:52:49.357Z
Tensibai
<p>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.</p>

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

<p>How can you mimmic this behavior in launch templates?</p>

<amazon-web-services><terraform><asg>
AWS launch template create-before-destory?
John Humphreys
# AWS launch template create-before-destory?

(Asked by: username_0 on 2020-02-20)

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?

**Tags:** amazon-web-services, terraform, asg


---

## 1 answers

### Answer by username_1 on 2020-02-20. Score: 4 | Accepted answer

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](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/autoscaling_group#with-latest-version-of-launch-template).

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

> **Comments:**
> **username_2**: The terraform docs link has changed, it's here currently: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/autoscaling_group#with-latest-version-of-launch-template  
> **username_1**: Feel free to edit :)  

---

