Skip to content

aws-cli: eb init & eb create --elb-type application stopped working after I created new AWS account

0

Hello,

I used to create Beanstalk app & environment with application load balancer (with default settings) this simple way using aws-cli:

# Initialize Elastic Beanstalk application
eb init "$APP_NAME" -r "$REGION" -p "$PLATFORM"

# Create the Elastic Beanstalk environment with an application load balancer
eb create "$ENV_NAME" --elb-type application --instance-types t3.micro --platform "$PLATFORM" -r "$REGION"

After I created a new AWS account to learn a few days ago, this script does not work on my new account anymore.

2024-10-13 20:56:23    ERROR   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:

How to solve this (step by step)? Was some part API deprecated? Is possible to set my new account to be able to create the application this way it worked for me before?

Many thanks

asked a year ago264 views
3 Answers
0

Thanks for your answer, but can't the problem be caused by this?

Enter image description here

answered a year ago
0

Hello.

As described in the documentation below, AWS has deprecated launch configurations in favor of launch templates.
As a result, you are experiencing the issue shown in the error message.
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environments-cfg-autoscaling-launch-templates.html

Starting on October 1, 2024, the Amazon EC2 Auto Scaling service will no longer support the creation of launch configurations for new accounts. This change is due to launch configurations being phased out and replaced by launch templates by the Amazon EC2 Auto Scaling service. For more information, see Auto Scaling launch configurations in the Amazon EC2 Auto Scaling User Guide.

When using eb cli, I think the problem can be solved by creating ".ebextensions" and specifying "RootVolumeSize" to "gp3" etc.
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options-general.html
https://repost.aws/questions/QUcX9TipxqSGeM5G7RORmqoQ/new-account-recently-created-unable-to-create-environments-on-elastic-beanstalk-launch-configuration-error#ANGe7da4VUTi6DEfHO9XMnWw

EXPERT
answered a year ago
-1

The issue you're experiencing with eb init and eb create not working as expected in your new AWS account is likely related to the service role required for Elastic Beanstalk. When using the EB CLI to create environments, a service role is necessary. In your previous account, this role was probably already set up, but in your new account, it may not exist yet.

To resolve this, you have a couple of options:

  1. Create an environment using the Elastic Beanstalk console first. This process will automatically create the required service role for you. After doing this once, your EB CLI commands should work as expected.

  2. If you prefer to stick with the CLI, you can try running eb create without any options first. The EB CLI will attempt to create the necessary service role if it doesn't exist. After this initial setup, your original commands should work.

It's worth noting that the EB CLI commands you're using haven't been deprecated. The functionality to create environments with application load balancers is still supported.

If you continue to experience issues, you may want to check your AWS account permissions to ensure you have the necessary rights to create Elastic Beanstalk resources and IAM roles.

Remember, when running eb create, you don't need to specify all options if you don't want to. The EB CLI will prompt you for any required information that's not provided in the command.

If these steps don't resolve your issue, you may need to check for any error messages or logs that the EB CLI provides when you run your commands. These can offer more specific information about what might be preventing the successful creation of your Elastic Beanstalk application and environment.
Sources
Managing Elastic Beanstalk environments with the EB CLI - AWS Elastic Beanstalk
eb create - AWS Elastic Beanstalk
Using the Elastic Beanstalk command line interface (EB CLI) - AWS Elastic Beanstalk

answered a year 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.