What is the difference between AWS ASG Launch Templates and Launch Configurations?
May 24
I'm getting confused when using Terraform to provision an auto-scaling group. Should I use launch configuration or launch template for EC2 properties, such as which AMI, instance types, ...?
I don't know what the difference is between them, which we should use and why they exist?
1 answer
Accepted answer · original discussion
May 24
Launch templates (LTs) are newer than launch configurations (LCs) and provide more options to work with. Thus, the AWS documentation recommends use of launch templates (LTs) over launch configuration (LCs):
We recommend that you create Auto Scaling groups from launch templates to ensure that you're getting the latest features from Amazon EC2.
One of the practical key differences between LT and LC is the fact that LC is immutable. Once you define it, you can't edit it. Only a replacement is an option. However, a single LT can have multiple versions:
defining a launch template instead of a launch configuration allows you to have multiple versions of a template. With versioning, you can create a subset of the full set of parameters and then reuse it to create other templates or template versions.
Also LTs provide more EC2 options for you to configure, for example, dedicated hosting can be set only using a LT. Similarly, ability to use T2 unlimited burst credit option is only available in a LT.
Thus if you can, its better to follow AWS recommendation and use LT.
1 question comment
Use comments to ask for clarification. Post a solution as an answer.
Nov 6