Why does Elastic Beanstalk still use Auto Scaling launch configurations after switching to an EC2 launch template?

0

EC2 / Elastic Beanstalk Why does Elastic Beanstalk still use Auto Scaling launch configurations after switching to an EC2 launch template? I configured my environment to use an EC2 launch template with IMDSv2 and gp3 volumes, but Elastic Beanstalk continues to use Auto Scaling launch configurations instead. Has anyone resolved this or is it a limitation with the Beanstalk service?

1 Answer
1
Accepted Answer

AWS is phasing out launch configurations in favor of launch templates, but there might be some confusion in your environment setup.

To ensure Elastic Beanstalk uses launch templates instead of launch configurations, you need to set at least one of these specific options in your environment configuration:

  1. Set RootVolumeType to gp3
  2. Include gp3 in BlockDeviceMappings
  3. Set DisableIMDSv1 to true
  4. Set EnableSpot to true

If you've already set these options but Elastic Beanstalk is still using launch configurations, you might need to check how you're applying these settings. You can use an .ebextensions configuration file to ensure these settings persist, especially after managed updates.

For example, create a file in the .ebextensions folder of your application source bundle with content like:

option_settings:
aws:autoscaling:launchconfiguration:
DisableIMDSv1: True
RootVolumeType: gp3

This should signal to Elastic Beanstalk to use launch templates instead of launch configurations. If you're still experiencing issues after properly configuring these settings, it might be worth checking your IAM permissions to ensure your account has the necessary permissions for working with launch templates, such as ec2:CreateLaunchTemplate and related permissions.

Starting October 1, 2024, new AWS accounts will no longer support the creation of launch configurations, making this transition to launch templates mandatory.
Sources
Help getting a Flask App to run on Elastic Beanstalk under new Launch Configuration | AWS re:Post
How to create EC2 Beanstalk with launch template? | AWS re:Post
Elastic Beanstalk Environment Creation Failing Due to Launch Configuration Restrictions (probably!) | AWS re:Post

answered 7 days ago
AWS
EXPERT
reviewed 7 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions