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.

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 | 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
Omax | Blog | From Memory Nightmare to Serverless: Bundling Files into a ZIP with AWS Lambda
8-10 min
August 25, 2026

From Memory Nightmare to Serverless: Bundling Files into a ZIP with AWS Lambda

A straightforward 'download all these files as one ZIP' request that worked perfectly on my laptop and... fell over the first day it met real production load. Here's the debugging story, the scaling options I ruled out, and why AWS Lambda was the right answer.

Read More
Omax | Blog | Clean Code vs. Overengineering: Where Should Developers Draw the Line?
10-12 min
August 21, 2026

Clean Code vs. Overengineering: Where Should Developers Draw the Line?

Clean code reduces unnecessary complexity; overengineering invents it. A practical guide to using context, evidence, and the cost of change to know when to stop adding abstractions...

Read More
Omax | Blog | Kafka vs RabbitMQ vs AWS EventBridge: Choosing the Right Architecture Based on Business Requirements
10-12 min
August 21, 2026

Kafka vs RabbitMQ vs AWS EventBridge: Choosing the Right Architecture Based on Business Requirements

Compare Kafka, RabbitMQ, and AWS EventBridge based on scalability, routing, event streaming, replay, infrastructure, and business requirements to choose the right architecture...

Read More
Omax | Blog | AI Integrations for QA Engineers
15-20 min
August 20, 2026

AI Integrations for QA Engineers

Learn how QA engineers can connect AI with Jira, GitHub, Slack, Notion and other tools to improve testing, bug tracking, reporting and QA productivity...

Read More
Omax | Blog | The Ultimate Guide to Amazon SES Setup with GoDaddy DNS
8-10 min
August 18, 2026

The Ultimate Guide to Amazon SES Setup with GoDaddy DNS

Learn how to set up Amazon SES with GoDaddy DNS. Complete step-by-step guide covering Easy DKIM, SPF, DMARC, custom MAIL FROM, and exiting the SES Sandbox...

Read More
Omax | Blog | AWS DevOps Agent Setup Guide with EC2
8-10 min
August 17, 2026

AWS DevOps Agent Setup Guide with EC2

Learn how to set up AWS DevOps Agent with EC2, CloudWatch, IAM, and Agent Spaces for AI-assisted monitoring, incident investigation, and root-cause analysis...

Read More
Omax | Blog | Multi-Tenancy Patterns in DynamoDB: Silo, Pool, and Bridge Models
6-10 min
August 13, 2026

Multi-Tenancy Patterns in DynamoDB: Silo, Pool, and Bridge Models

If you've already made the jump from a relational database to DynamoDB see our guide on moving relational data from SQL to DynamoDB...

Read More
Omax | Blog | We stopped leaving the IDE to design. Here’s our Cursor → Figma flow
8-10 min
August 10, 2026

We stopped leaving the IDE to design. Here’s our Cursor → Figma flow

Cursor drafts fast, catches gaps early, and still clips fields and breaks layouts. Here's the real pros-and-cons breakdown of our workflow...

Read More

Ready to Work With Us?

Most engagements start with a 20-minute conversation. No pitch, no pressure - just an honest discussion about what you're building and whether we're the right fit.