Managing, deploying, and monitoring AWS Elastic Beanstalk applications using EB CLI

Deploy and monitor beanstalk applications ebcli

Cloud/Devops
Feb 22, 2022
4-6 min

Share blog

Introduction

Elastic Beanstalk (EB) is a managed AWS service used to deploy, manage, and scale web applications and services. We can either use Elastic Beanstalk from the AWS Management console or from the command line using the Elastic Beanstalk Command Line Interface (EB CLI).

In this blog, we will use the Elastic Beanstalk Command Line Interface to deploy and monitor web applications. We will need EB CLI for this, Set up the Elastic Beanstalk CLI

In this blog, we will create a sample application and deploy it to the AWS cloud using the EB CLI.

Step 1 : Setup sample application

We need to setup a directory for the Elastic Beanstalk application, for this we will create a new folder called sample-app to use as a working directory and navigate into it.

python
$ mkdir sample-app
$ cd sample-app

Using command line, setup a new EB application using the following command:

python
1$ eb init

Above command will prompt us to select a Region where the application should be deployed. Select the nearest region or Enter for the default one.

It will prompt for the application name, press Enter for the default one.

javascript
Enter Application Name
(default is "sample-app"):

Next we will be prompted for user credentials. Provide the Access key ID and Secret access key values, setup for the IAM user.

javascript
You have not yet set up your credentials or your credentials are incorrect
You must provide your credentials.
(aws-access-id): Access-key-id-here
(aws-secret-key): Secret-key-id-here

Now select a platform to use. We can choose any no corresponds to the following given platforms, here we will go with 6) Node.js and press Enter.

javascript
Select a platform.
1) .NET Core on Linux
2) .NET on Windows Server
3) Docker
4) Go
5) Java
6) Node.js
7) PHP
8) Packer
9) Python
10) Ruby
11) Tomcat
(make a selection): 6

Now, it will prompt you for the platform branch or version, choose the one of your choice.

python
Select a platform branch.
1) Node.js 18 running on 64bit Amazon Linux 2023
2) Node.js 18 running on 64bit Amazon Linux 2
3) Node.js 16 running on 64bit Amazon Linux 2
4) Node.js 14 running on 64bit Amazon Linux 2
(default is 1):

Now it will prompt you for the SSH, depending on your need, here we will go with yes .i.e. Y

javascript
1Cannot setup CodeCommit because there is no Source Control setup, continuing with initialization
2
3Do you want to set up SSH for your instances?
4
5(Y/n): Y

Choose SSH key pair

javascript
Type a keypair name.
(Default is aws-eb):

Here the application setup concludes.

Step 2 : Deploy application

Now, let’s start deployment of the application, for the run the following command,

javascript
$ eb create

When prompted to “Enter Environment Name”, provide your name or press Enter for the default name.

javascript
Enter Environment Name
(default is sample-app-dev):

When prompted to “Enter DNS CNAME prefix” type in a unique DNS name for the application and press Enter.

javascript
Enter DNS CNAME prefix
(default is sample-app-dev22):

Next, it will prompt to select a Load Balancer type. Choose Enter to accept the default or chose the one of your choice

javascript
Select a load balancer type
1) classic
2) application
3) network
(default is 2): 2

For Fleet requests type N, or you can go with y if you need it.

javascript
Would you like to enable Spot Fleet requests for this environment? (y/N): N

When prompted to specify or create an Elastic Beanstalk service role, press Enter to have Elastic Beanstalk create one for you.

Let's Build Something Great Together

Ready to transform your idea into a powerful software solution? Talk to our experts and get a free consultation.

Contact Us

Note : This prompt only shows up the first time you use Elastic Beanstalk.

javascript
2.0+ Platforms require a service role. We will attempt to create one for you. You can specify your own role using the --service-role option.
Type "view" to see the policy, or just press ENTER to continue:

Press Y to download the sample application code into your current directory

javascript
NOTE: The current directory does not contain any source code. Elastic Beanstalk is launching the sample application instead.
Do you want to download the sample application into the current directory? (Y/n): Y

As this process proceeds, the EB CLI will output progress events to the command line. The EB CLI will warn you that it is creating a sample application for you. Then it will create the AWS resources to run the application, and then deploy the application to those resources.

Step 3 : Monitor application

Following command will open your live application in a browser,

javascript
$ eb open

To view the status of the application the EB CLI has created for you, enter the following command,

javascript
$ eb status

Output

javascript
Environment details for: sample-app-dev
Application name: sample-app
Region: us-west-2
Deployed Version: app-230808_191013988856
Environment ID: e-fqpcayzeyi
Platform: arn:aws:elasticbeanstalk:us-west-2::platform/Node.js 18 running on 64bit Amazon Linux 2023/6.0.0
Tier: WebServer-Standard-1.0
CNAME: sample-app-dev22.us-west-2.elasticbeanstalk.com
Updated: 2023-08-08 14:12:52.097000+00:00
Status: Ready
Health: Green
Alert: An update to the EB CLI is available. Run "pip install --upgrade awsebcli" to get the latest version.

To view the health of the computing resources the EB CLI has created for you, enter the following command,

javascript
$ eb health]
Terminal-style monitoring dashboard showing a healthy Node.js 18 web server on an Amazon Linux EC2 instance with OK status, low CPU load, and successful deployment.

At the end to terminate all the created resources, run the following command,

javascript
$ eb terminate -all

Blogs

Discover the latest insights and trends in technology with the Omax Tech Blog.

View All Blogs
Omax | Blog | How to Add LiveKit Video Calling to a Next.js App
12-14 min
September 11, 2026

How to Add LiveKit Video Calling to a Next.js App

Add embedded video & audio calling to Next.js with LiveKit Cloud. Compared vs Twilio, Daily, Agora, Zoom — plus token auth, guests & recording.

Read More
Omax | Blog | We chose ECS over EKS: what we gained and what we gave up
8-10 min
September 10, 2026

We chose ECS over EKS: what we gained and what we gave up

An honest comparison of ECS vs EKS the costs, tradeoffs, and real-world reasoning behind choosing ECS for a production platform on AWS.

Read More
Omax | Blog | Upgrading Legacy Systems: From Outdated Technology to Competitive Advantage
8-10 min
September 07, 2026

Upgrading Legacy Systems: From Outdated Technology to Competitive Advantage

Learn how to upgrade legacy systems through application modernization, API integration, cloud migration, security improvements, and incremental system upgrades without disrupting business operations.

Read More
Omax | Blog | Building Distributed Tracing and Observability with AWS X-Ray
12-14 min
September 04, 2026

Building Distributed Tracing and Observability with AWS X-Ray

A practical guide to correlating requests across a multi-tier application using correlation IDs, AWS X-Ray segments, and structured logging for faster incident debugging.

Read More
Omax | Blog | Designing Before and After AI: What Really Changed
6-7 min
September 03, 2026

Designing Before and After AI: What Really Changed

A look at how AI has transformed UI/UX design from manual wireframes and slow research to AI-assisted prototyping, design-to-code, and personalization at scale.

Read More
Omax | Blog | Beyond Prompting: Managing Context and Tokens in AI Coding Tools
12-14 min
September 03, 2026

Beyond Prompting: Managing Context and Tokens in AI Coding Tools

Ever wondered why your AI coding agent starts losing context or hits a hard limit mid-task? The answer lies in tokens and the context window. Good AI coding is not about giving the model the most information. It is about giving it the right information at the right time.

Read More
Omax | Blog | What Is llms.txt? How It Helps Google, AI Search, and Agentic Browsing Find Your Website
10-12 min
August 31, 2026

What Is llms.txt? How It Helps Google, AI Search, and Agentic Browsing Find Your Website

Learn what llms.txt is, how it differs from sitemap.xml and robots.txt, and how it can help your site get found by Google, AI search tools, and AI agents.

Read More
Omax | Blog | Build an Automated Image Compression Script with Sharp and SVGO
7-8 min
August 28, 2026

Build an Automated Image Compression Script with Sharp and SVGO

Compress images from the terminal with a Node.js script powered by Sharp and SVGO a safe, two-step workflow that keeps your site fast without bloating your repo.

Read More
Omax | Blog | The Right Way to Migrate from MySQL to AWS Aurora DSQL
7-8 min
August 25, 2026

The Right Way to Migrate from MySQL to AWS Aurora DSQL

Migrating a production database is one of the highest-risk changes you can make to an application. Moving from MySQL to AWS Aurora DSQL raises the stakes further...

Read More