In 2010, AWS introduced launch configurations to define instance parameters for EC2 Auto Scaling groups. However, in 2017, AWS rolled out launch templates, which serve as a more efficient successor to launch configurations. These templates simplify the instance launch process across various services by consolidating parameters into a single resource. While launch configurations have remained available, they have not received the new features that have been consistently added to launch templates.
AWS now encourages customers still using launch configurations to transition to launch templates. While launch configurations will continue to be supported, no additional features will be added to them going forward. Our focus will shift entirely to enhancing launch templates. Though you may continue using launch configurations, migrating to launch templates will allow you to leverage the latest EC2 features. By the end of 2022, we will also cease support for new instance types in launch configurations, with the aim of fully transitioning all customers to launch templates by that time.
Transitioning to launch templates is a straightforward process that can be accomplished today. For more guidance on this migration, refer to this blog post. If you encounter any barriers to making the switch or have specific concerns, please reach out to AWS Support.
Comparing Launch Configurations and Launch Templates
Launch configurations have been integral to Amazon EC2 Auto Scaling Groups since their inception in 2010. They allow users to define configurations for Auto Scaling groups, including AMIs and instance types. However, with the introduction of launch templates in 2017, the process was streamlined significantly. Launch templates have enabled the introduction of numerous new features, such as Mixed Instance Policies, Targeted Capacity Reservations, and unlimited mode for burstable performance instances—capabilities that are not available through launch configurations.
Key benefits of using launch templates include:
- Support for multiple instance types and purchasing options within a single Auto Scaling group.
- The ability to launch Spot Instances using the capacity-optimized allocation strategy.
- Capacity to launch instances into existing Capacity Reservations through Auto Scaling groups.
- Support for unlimited mode for burstable performance instances.
- Compatibility with Dedicated Hosts.
- The ability to combine CPU architectures like Intel, AMD, and ARM (Graviton2).
- Enhanced governance via IAM controls and versioning.
- Automation of instance deployment using Instance Refresh.
Identifying Your Use of Launch Configurations
To assess your current use of launch configurations, utilize the Launch Configuration Inventory Script. This script can generate an inventory of all launch configurations across your account and regions. It can be run with various options, depending on your account access level. More details can be found in this GitHub post.
Once the script completes, check the generated inventory.csv file to determine how many launch configurations need conversion or deletion.
Transitioning to Launch Templates
If you’re prepared to switch to launch templates, the process is mostly automated through the AWS Management Console. For Infrastructure as Code (IaC) users, popular tools like CloudFormation and Terraform already support launch templates, as do the AWS CLI and SDKs.
To transition, ensure that your user has the necessary permissions. Here’s a brief overview of the steps:
- Open the EC2 Launch Configuration console (sign in if required).
- Click on the “Copy to launch template” button and select “Copy all.”
- Alternatively, choose specific launch configurations to copy individually.
- Review the list of templates and click on “Copy” when ready.
- Upon completion, navigate to the EC2 Launch Template console to view your newly created launch templates.
- To replace launch configurations in your Auto Scaling group, go to the Auto Scaling group console, select your group, and click “Edit.”
- Scroll to the Launch configuration section and click “Switch to launch template.”
- Select your new launch template, confirm your settings, and click “Update.”
Once you’ve migrated, you can prevent new launch configurations from being created by modifying IAM permissions to deny the autoscaling:CreateLaunchConfiguration
action. Instances in the Auto Scaling group will continue to operate normally, but any new instances will now use the updated launch template. For immediate updates, utilize Instance Refresh to ensure all instances are running the same launch template version.
For those using CloudFormation, incorporate the AWS::EC2::LaunchTemplate
resource into your stack template file. Update your Auto Scaling group resource definition to add a LaunchTemplate
property, removing the existing LaunchConfigurationName
property. Similarly, for Terraform users, include an aws_launch_template
resource and update aws_autoscaling_group
resources to reference the new template.
For further insights, you may find it beneficial to check out this resource, which is an authority on the topic.
Leave a Reply