Skip to content

How to create EC2 Beanstalk with launch template?

0

Hi I am new to AWS and have watched many videos on deploying a node.js application with EC2 Beanstalk and followed the tutorial After failing my effort for the last one and half days now, I couldn't work out how I can use this service. I created a launch template, but I'm not sure how to use it with Beanstalk. I am getting the error message below but don't know how to solve this. I tried to create a launch template, but not sure how to use it with Beanstalk and deploy my application. Is there any video or tutorial to follow and create the application?

"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. "

How can I create EC2 Beanstalk application for new user registered after October 1st?

asked 2 years ago2.7K views

4 Answers
1

Setting RootVolumeType to GP3 in the environment settings is the simplest way to have Beanstalk use a Launch Template

https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environments-cfg-autoscaling-launch-templates.html

If your attempt to create a new environment is not successful, it could be due to the Amazon EC2 Auto Scaling service restricting your ability to create launch configurations. If the error indicates that the CreateLaunchConfiguration API throws an UnsupportedOperationException, then you must set a configuration option in your environment to direct Elastic Beanstalk to use launch templates instead of launch configurations. For more information, see Option settings for launch templates.

EXPERT

answered 2 years ago

  • this worked for me, or at least got me a bit closer. EB has been a headache.

0

I apologize, but there seems to be a misunderstanding in your question. Elastic Beanstalk and EC2 launch templates are separate services that are not directly integrated in the way you're describing.

Elastic Beanstalk is a platform-as-a-service (PaaS) offering that handles the deployment and scaling of web applications, including Node.js applications. It automatically handles the details of capacity provisioning, load balancing, and application health monitoring.

The error message you're receiving suggests that your AWS account no longer supports the creation of launch configurations, which is an older feature. Instead, AWS now recommends using launch templates for Auto Scaling groups.

However, when using Elastic Beanstalk, you typically don't need to create launch templates manually. Elastic Beanstalk manages the underlying infrastructure for you, including the creation of necessary resources like Auto Scaling groups.

To deploy your Node.js application using Elastic Beanstalk, you should:

  1. Prepare your Node.js application code and ensure it's ready for deployment.
  2. Open the Elastic Beanstalk console.
  3. Click "Create a new environment".
  4. Choose "Web server environment".
  5. Select "Node.js" as your platform.
  6. Upload your application code.
  7. Configure any additional options as needed.
  8. Click "Create environment" to deploy your application.

Elastic Beanstalk will then handle the creation of the necessary resources and deploy your application.

If you're still encountering issues, it might be helpful to review the AWS Elastic Beanstalk documentation for Node.js or contact AWS support for more specific assistance with your account and configuration.
Sources
Create an Amazon EC2 launch template - Amazon Elastic Compute Cloud
Use Amazon EC2 launch templates to control launching Amazon EC2 instances - Amazon Elastic Compute Cloud

answered 2 years ago

  • Thank you for answering my question, I followed the same steps as you described except upload my application code, I selected sample application instead, but I am getting above message in the log, after few attempts I just tried creating template. Not sure why it is failing with new user account, I can see below notification on my console when I start creating new application.

    "New accounts only support launch templates Starting on October 1, 2024, Amazon EC2 Auto Scaling will no longer support the creation of launch configurations for new accounts. Existing environments will not be impacted. For more information about other situations that are impacted, including temporary option settings required for new accounts, refer to Launch templates in the Elastic Beanstalk Developer Guide."

    I was expecting as you described, just put the application name and platform then skip to review and submit, then I receive the error.

0

I believe there is a problem with the sample code - is it still using launch configurations? I'm having the same problem that Nizar is having and we're both using the sample code.

answered 2 years ago

-1

To deploy your Node.js application on AWS Elastic Beanstalk:

  • Prepare Your App: Ensure it has a proper package.json.
  • Install EB CLI: Install the Elastic Beanstalk CLI from the official guide.
  • Initialize Your App: In your project directory, run eb init to set up your application.
  • Create Environment: Use eb create <environment-name> to create an environment.
  • Deploy Your App: Run eb deploy to deploy your application.
EXPERT

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.