Skip to content

Unable to create Elastic Bean Stalk env.

0

I've been working on creating a sample app with various configurations, including single instance vs. HA, but I keep encountering the same error in different ways. From what I understand, the launch template has been introduced and is now mandatory for my account, so I manually created one in EC2 and tried using it. I also assume that the custom configuration is related to the launch template creation, as it starts with a default template ID. However, I'm completely stuck, even with a simple test application. How should I proceed?

Creating Auto Scaling launch configuration failed Reason: Resource handler returned message: "The Launch Configuration creation operation is not available in your account. Use launch templates to create configuration templates for your Auto Scaling groups. (Service: AutoScaling, Status Code: 400, Request ID: b54ca6aa-7f17-48f0-ba5d-4e23389dd469)" (RequestToken: d99629c8-bc06-6461-8d0a-8f99c69d881f, HandlerErrorCode: GeneralServiceException)

1 Answer
0

The error you're encountering is related to recent changes in AWS Elastic Beanstalk regarding the use of launch configurations. AWS is phasing out launch configurations and replacing them with launch templates. In accounts and regions where Elastic Beanstalk environments don't already exist, creating new launch configurations is no longer possible.

To resolve this issue and successfully create your Elastic Beanstalk environment, you need to signal to Elastic Beanstalk to use launch templates instead of launch configurations. You can do this by setting at least one of the following options in your environment configuration:

  1. DisableIMDSv1
  2. RootVolumeType
  3. BlockDeviceMappings
  4. EnableSpot

The easiest way to implement this is by setting the RootVolumeType option. You can do this through the Elastic Beanstalk console, AWS CLI, or API calls when creating your environment.

If you're using the Elastic Beanstalk console, look for these options under the "Capacity" configuration section when creating or updating your environment.

If you're using the AWS CLI, you can add an option setting like this:

--option-settings Namespace=aws:autoscaling:launchconfiguration,OptionName=RootVolumeType,Value=gp2

Alternatively, you could try enabling Spot instances by setting the EnableSpot option, which will also cause Elastic Beanstalk to use launch templates.

It's important to note that if your environment uses functionality requiring Amazon EC2 launch templates, your user policy must have the required permissions. If it doesn't, creating or updating the environment might fail. To ensure you have the necessary permissions, you can use the AdministratorAccess-AWSElasticBeanstalk managed user policy or add the required permissions to your custom policy.

By implementing one of these options, you should be able to successfully create your Elastic Beanstalk environment using launch templates instead of launch configurations.
Sources
Creating an Elastic Beanstalk without success | AWS re:Post
Auto Scaling group configuration for your Elastic Beanstalk environment - AWS Elastic Beanstalk
Modifying the resources that Elastic Beanstalk creates for your environment - AWS Elastic Beanstalk

answered 2 years 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.