Launch Template vs Launch Configuration and How to Migrate

Learn about the difference between launch template vs launch configuration and find out how to migrate from configurations to templates with our guide.

Patrick Londa
Author
Jan 6, 2023
 • 
5
 min read
Share this post

Starting in 2023, AWS launch configurations stopped supporting newly released EC2 instance types, and by October 1, 2024, new AWS accounts will be unable to create new launch configurations altogether. AWS is urging all customers to switch from using launch configurations to launch templates to continue accessing new instance types and features.

Here are the key changes:

  • Launch configurations no longer support new EC2 instance types released after Dec. 31st, 2022.
  • By October 1, 2024, new AWS accounts will not be able to create new launch configurations using any AWS interface.
  • Migration to launch templates ensures continued support and access to new EC2 features.

In this guide, we’ll explain the basics of launch configurations and launch templates, show the steps for migrating them over, and highlight the importance of starting an instance refresh to update existing instances automatically.

Launch Template vs Launch Configuration

Launch Configurations and Launch Templates are both tools in AWS for defining instance settings for auto-scaling and launching EC2 instances, but they differ in flexibility and features:

  • Launch Configurations: An older method that allows you to specify settings like instance type, key pairs, and security groups. However, they are limited in functionality and cannot be modified once created.
  • Launch Templates: A more flexible and feature-rich alternative that supports multiple instance types, allows easier customization and updates, and includes additional features like support for newer instance types, network configurations, and advanced parameters.

Below is a comparison to illustrate the differences between Launch Templates and Launch Configurations:

Feature/Aspect Launch Template Launch Configuration
Versioning Supports multiple versions for updates No versioning; cannot be modified once created
Instance Type Flexibility Allows specifying multiple instance types Supports only a single instance type
Supported Features Supports advanced features like T2/T3 unlimited, placement groups, and capacity reservations Limited to basic EC2 settings
Modification Can be updated and modified easily Immutable; must create a new configuration for changes
Cost Allocation Tags Supports cost allocation tags Does not support cost allocation tags
Network Configuration Supports advanced network settings, such as ENIs and IPv6 Basic network configuration only
Recommendation Recommended for new deployments due to flexibility and more features Legacy tool, not recommended for new use

Launch Configurations

Launch configurations are instance configuration settings utilized by an EC2 Auto Scaling group to inform the new EC2 instances it launches. You must specify standard information when setting up an AWS launch configuration, including the following:

  • ID of the Amazon Machine Image (AMI)
  • Instance Type
  • Key Pair
  • Security Group(s)
  • Block Device Mapping

For inspiration, you can use similar settings for previously launched EC2 instances if they match your use case. Once you create your launch configuration, you cannot make changes to it. You can only create a new one and update your Auto Scaling group to use the new one. If you do that, existing instances will not be immediately updated.

Launch Templates

Launch templates function similarly to launch configurations by specifying instance configuration information with similar information you would place in a launch configuration file. The major difference between launch configurations and launch templates is that you can set up multiple versions of a launch template.

Versioning launch templates lets you establish a subset of the complete parameter set. You can reuse these to set up other versions of the base launch template. For example, you can create a launch template with a defined base configuration without including an AMI or user data script.

After creating the launch template, you can add a new version with the AMI and user script for testing. You end up with two versions of the template. That means you can always have a base configuration for reference, then create new template versions as needed. It’s also possible to delete test template versions when they are no longer necessary.

Launch templates enable accessing the latest improvements. Some Amazon EC2 Auto scaling features aren’t available when you use launch configurations. Launch templates also let you use newer generation features of Amazon EC2.

While launch parameters are optional, you can’t add an AMI to one if you do not specify it when creating an Auto Scaling group. If you specify an AMI but leave out the instance type, it’s possible to add one or more when setting up your Auto Scaling group.

How to Migrate Launch Configurations to Launch Templates

Copying launch configurations to convert them to launch templates, you will need to use the AWS Management Console.

Migrating One Launch Configuration

Anyone currently using launch configurations can migrate them over to launch templates by copying them into the console.

  1. Open the EC2 console.
  2. Look for Auto Scaling in the navigation pane, then choose Launch Configurations.
  3. Choose the launch configuration to copy.
  4. Select Copy to launch template, Copy selected to set up a new template with the same name and options as your configuration.
  5. Add the name of your current launch configuration file or a new name in the New launch template name field. The name must be unique.
  6. Select Copy.

Migrating All Launch Configurations

Follow the steps below if you wish to move all your launch configurations to launch templates in the console:

  1. Open the EC2 console.
  2. Look for Auto Scaling in the navigation pane, then choose Launch Configurations.
  3. Choose the launch configuration to copy.
  4. Select Copy to launch template, Copy all to copy all your configurations within the current Region to a new launch template named after your configuration.
  5. Select Copy.

Updating Auto Scaling Groups to Use Launch Templates

Using the AWS Console:

  1. Navigate to the AWS EC2 console, open the navigation pane, and select Auto Scaling Groups.
  2. Click on the check box associated with the Auto Scaling group you want to update.
  3. In the Details tab, choose Launch configuration, then click Edit.
  4. Select Switch to launch template, then select the appropriate launch template.
  5. You’ll need to select a Version for the launch template. You can customize whether the Auto Scaling group uses a default version when it scales out, or uses the latest version.
  6. Click Update to apply the changes.

Using the AWS CLI:

You can run this update-auto-scaling-group command:

aws autoscaling update-auto-scaling-group
--auto-scaling-group-name <value>
--launch-template <value>

An Auto Scaling group cannot have both a launch configuration and launch template parameter set. To update your Auto Scaling group to use a launch template instead of a launch configuration, you can include a launch template value in this command, like in this example:

aws autoscaling update-auto-scaling-group
    --auto-scaling-group-name my-asg
    --launch-template LaunchTemplateName=my-template-for-auto-scaling,Version='2'

Once you’ve migrated your Auto Scaling groups to use launch templates instead of launch configurations, you should stop creating new launch configurations and only create launch templates and new versions.

Replacing Launch Configurations Automatically with Blink

If you have several Auto Scaling groups, making these updates can be manual and time-consuming. You also can’t ensure that new launch configurations are not created and utilized in your AWS EC2 Auto Scaling groups.

With Blink, you can use a no-code automation to quickly identify Auto Scaling groups that are using launch configurations, convert those launch configurations to launch templates, and update the groups accordingly. You can also set up checks to detect new launch configurations and notify owners that they should use launch templates instead.

Get started with Blink today to see how easy automating workflows can be.