Experiment No:3
Aim: To study and Implement Platform as a Service using AWS Elastic Beanstalk.
Objective:
To demonstrate the steps to deploy Web applications or Web services written in
different languages on AWS Elastic Beanstalk/ Microsoft Azure App Service.
Theory:
What is AWS Elastic Beanstalk?
Amazon Web Services (AWS) comprises over one hundred services, each of which
exposes an area of functionality. While the variety of services offers flexibility for
how you want to manage your AWS infrastructure, it can be challenging to figure
out which services to use and how to provision them. With Elastic Beanstalk, you
can quickly deploy and manage applications in the AWS Cloud without having to
learn about the infrastructure that runs those applications. Elastic Beanstalk reduces
management complexity without restricting choice or control. You simply upload
your application, and Elastic Beanstalk automatically handles the details of capacity
provisioning, load balancing, scaling, and application health monitoring.
Elastic Beanstalk supports applications developed in Java, .NET, [Link], PHP,
Python, and Ruby. When you deploy your application, Elastic Beanstalk builds the
selected supported platform version and provisions one or more AWS resources,
such as Amazon EC2 instances, to run your application. You can interact with Elastic
Beanstalk by using the Elastic Beanstalk console, the AWS Command Line Interface
(AWS CLI), or eb, a high-level CLI designed specifically for Elastic Beanstalk. You
can also perform most deployment tasks, such as changing the size of your fleet of
Amazon EC2 instances or monitoring your application, directly from the Elastic
Beanstalk web interface (console).
To use Elastic Beanstalk, you create an application, upload an application version in
the form of an application source bundle (for example, a Java .war file) to Elastic
Beanstalk, and then provide some information about the application. Elastic
Beanstalk automatically launches an environment and creates and configures the
AWS resources needed to run your code. After your environment is launched, you
can then manage your environment and deploy new application versions. The
following diagram illustrates the workflow of Elastic Beanstalk.
After you create and deploy your application, information about the application—
including metrics, events, and environment status—is available through the Elastic
TE CSE AIML/ Semester – VI / Cloud Computing/ Academic Year: 2025-26 / First Half of 2026
Beanstalk console, APIs, or Command Line Interfaces, including the unified AWS
CLI.
Elastic Beanstalk concepts
AWS Elastic Beanstalk enables you to manage all of the resources that run
your application as environments. Here are some key Elastic Beanstalk
concepts.
Application
An Elastic Beanstalk application is a logical collection of Elastic Beanstalk
components, including environments, versions, and environment configurations. In
Elastic Beanstalk an application is conceptually similar to a folder.
Application version
In Elastic Beanstalk, an application version refers to a specific, labeled iteration of
deployable code for a web application. An application version points to an Amazon
Simple Storage Service(Amazon S3) object that contains the deployable code, such
as a Java WAR file. An applicationversion is part of an application. Applications can
have many versions and each application version is unique. In a running
environment, you can deploy any application version you already uploaded to the
application, or you can upload and immediately deploy a new application version.
You might upload multiple application versions to test differences betweenone
version of your web application and another.
Environment
An environment is a collection of AWS resources running an application version.
Each environment runs only one application version at a time, however, you can run
the same application version or different application versions in many environments
simultaneously. When you create an environment, Elastic Beanstalk provisions the
resources needed to run theapplication version you specified.
Environment tier
When you launch an Elastic Beanstalk environment, you first choose an environment
tier. Theenvironment tier designates the type of application that the environment
runs, and determines what resources Elastic Beanstalk provisions to support it. An
application that serves HTTP requests runs in a web server environment tier. A
backend environment that pulls tasks from an Amazon Simple Queue Service
(Amazon SQS) queue runs in a worker environment tier.
Environment configuration
An environment configuration identifies a collection of parameters and settings that
define howan environment and its associated resources behave. When you update an
TE CSE AIML/ Semester – VI / Cloud Computing/ Academic Year: 2025-26 / First Half of 2026
environment’s configuration settings, Elastic Beanstalk automatically applies the
changes to existing resources or deletes and deploys new resources (depending on
the type of change).
Saved configuration
A saved configuration is a template that you can use as a starting point for creating
unique environment configurations. You can create and modify saved configurations,
and apply themto environments, using the Elastic Beanstalk console, EB CLI, AWS
CLI, or API. The API andthe AWS CLI refer to saved configurations as configuration
templates.
Platform
A platform is a combination of an operating system, programming language runtime,
web server, application server, and Elastic Beanstalk components. You design and
target your web application to a platform. Elastic Beanstalk provides a variety of
platforms on which you can build your applications.
AWS Elastic Beanstalk Features
AWS Elastic Beanstalk is the fastest way to get web applications up and running on
AWS. You can simply upload your application code, and the service automatically
handles details such as resource provisioning, load balancing, auto scaling, and
monitoring. Elastic Beanstalk is ideal if you have a PHP, Java, Python, Ruby,
[Link],
.NET, Go, or Docker web application. Elastic Beanstalk uses core AWS services
such as Amazon Elastic Compute Cloud (EC2), Amazon Elastic Container Service
(ECS), AWS Auto Scaling, and Elastic Load Balancing (ELB) to easily support
applications that need to scale to serve millions of users.
Wide selection of application platforms
AWS Elastic Beanstalk supports web applications written in many popular languages
and frameworks. It requires no or minimal code changes to go from development
machine to the cloud. Development options for deploying your web applications
include Java, .NET, Node .js, PHP, Ruby, Python, Go, and Docker.
Variety of application deployment options
With AWS Elastic Beanstalk, you can deploy your code through the AWS
Management Console, Elastic Beanstalk Command Line Interface, Visual Studio,
and Eclipse. Multiple deployment policies—all at once, rolling, rolling with an
additional batch, immutable, and blue/green—offer choices for the speed and safety
of deploying your applications while reducing the administrative burden.
TE CSE AIML/ Semester – VI / Cloud Computing/ Academic Year: 2025-26 / First Half of 2026
Monitoring
Elastic Beanstalk provides a unified user interface (UI) to monitor and manage the
health of your applications.
Application Health
Elastic Beanstalk collects 40+ key metrics and attributes to determine the health of
your applications. With the Elastic Beanstalk Health Dashboard, you can visualize
overall application health and customize application health checks, health
permissions, and health reporting in one UI.
Monitoring, Logging, and Tracing
Elastic Beanstalk integration with Amazon CloudWatch and AWS X-Ray means you
can use monitoring dashboards to view key performance metrics such
as latency, CPU utilization, and response codes. You can also set up CloudWatch
alarms to get notified when metrics exceed your chosen thresholds. Updates and
management
You can choose to automatically get the latest platform versions of your Elastic
Beanstalk environment and new patches using managed platform updates. An
immutable deployment mechanism ensures these updates are implemented safely.
For ongoing management, you can also customize application properties, create
alarms, and enable e-mail notifications via Amazon Simple Notification Service
(Amazon SNS).
Scaling
Elastic Beanstalk uses Elastic Load Balancing and Auto Scaling to automatically
scale your application in and out based on its specific needs. Multiple availability
zones give you an option to improve application reliability and availability.
Customization
With Elastic Beanstalk, you have the freedom to select the AWS resources, such as
Amazon EC2 instance type including Spot instances, that are optimal for your
application. You also retain full control over the AWS resources powering your
application. If you decide you want to take over some (or all) of the elements of your
infrastructure, you can do so seamlessly by using Elastic Beanstalk's management
capabilities.
Compliance
Elastic Beanstalk meets the criteria for ISO, PCI, SOC 1, SOC 2, and SOC 3
compliance along with the criteria for HIPAA eligibility. This means applications
TE CSE AIML/ Semester – VI / Cloud Computing/ Academic Year: 2025-26 / First Half of 2026
running on Elastic Beanstalk can process regulated financial data or protected health
information (PHI).
AWS Graviton support
AWS Graviton arm64-based processors deliver the best price performance for your
cloud workloads running in Amazon EC2. With AWS Graviton on Elastic Beanstalk,
you can selectEC2 instance types to meet optimization needs of your workloads and
benefit from improved price performance over a comparable x86based processor.
TE CSE AIML/ Semester – VI / Cloud Computing/ Academic Year: 2025-26 / First Half of 2026
Procedure
Step 1: Sign in to the AWS Management Console using your credentials.
Step 2: Install Required Software
Python 3.14.2 or newer
[Link]
AWS CLI (Latest Version)
[Link]
TE CSE AIML/ Semester – VI / Cloud Computing/ Academic Year: 2025-26 / First Half of 2026
Scroll down - download and run the AWS CLI MSI installer for windows
Elastic Beanstalk CLI (EB CLI)
Open Command Prompt and run: pip install awsebcli –upgrade
Verify Installation python
–version
aws ––version
TE CSE AIML/ Semester – VI / Cloud Computing/ Academic Year: 2025-26 / First Half of 2026
eb –version
Step 3: Configure AWS CLI
Open Command Prompt.
Run the following command: aws configure
Enter the required details:
AWS Access Key ID
AWS Secret Access Key
Default region name (Example: ap-south-1)
Default output format: json
Step 4: Create Project Directory
Create a new directory for the project: mkdir eb-flask-app
Move into the directory: cd eb-flask-app
Step 5: Create Virtual Environment
Create a virtual environment: python -m venv venv
Activate the virtual environment: venv\Scripts\activate
TE CSE AIML/ Semester – VI / Cloud Computing/ Academic Year: 2025-26 / First Half of 2026
Step 6: Install Flask
Install Flask framework: pip install flask
Create [Link] file: pip freeze > [Link]
Step 7: Create Flask Application File
Create a file named [Link] (Elastic Beanstalk expects the variable name application)
from flask import Flask
application = Flask(__name__)
@[Link]("/") def
home():
return "Hello Everyone! Welcome to AWS Elastic Beanstalk" if
__name__ == "__main__":
[Link]()
TE CSE AIML/ Semester – VI / Cloud Computing/ Academic Year: 2025-26 / First Half of 2026
Step 8: Initialize Elastic Beanstalk Application
Run the following command: eb init
Provide the details as follows:
• Select Region
• Application Name (Example: flask-eb-app)
• Platform: Python
• Python Version: Latest available
TE CSE AIML/ Semester – VI / Cloud Computing/ Academic Year: 2025-26 / First Half of 2026
• SSH Setup: Yes (Optional)
Step 9: Create Elastic Beanstalk Environment
Create the environment using the command: eb create flask-env
This process will:
• Create an EC2 instance
• Configure Load Balancer
• Deploy the Flask application Deployment may take 5–10 minutes.
TE CSE AIML/ Semester – VI / Cloud Computing/ Academic Year: 2025-26 / First Half of 2026
Step 10: Access the Application
After successful deployment, run: eb open
The application will open in the web browser using the Elastic Beanstalk URL.
Step 11: Monitor Application
Check application status: eb status
TE CSE AIML/ Semester – VI / Cloud Computing/ Academic Year: 2025-26 / First Half of 2026
View logs: eb logs
Step 12: Verify AWS Resources
From AWS Management Console, verify the following:
TE CSE AIML/ Semester – VI / Cloud Computing/ Academic Year: 2025-26 / First Half of 2026
1. Elastic Beanstalk → Environment
2. EC2 → Instances Running
3. Load Balancer → Active
4. CloudWatch → Monitoring Metrics
• Search CloudWatch - Open CloudWatch Dashboard • Click Metrics • Select Elastic
Beanstalk - Click Environment metrics
• Choose your environment (flask-env)
TE CSE AIML/ Semester – VI / Cloud Computing/ Academic Year: 2025-26 / First Half of 2026
Step 14: Terminate Environment
Terminate the environment after practical completion: eb terminate flask-env
(Optional) Delete the application: eb delete
TE CSE AIML/ Semester – VI / Cloud Computing/ Academic Year: 2025-26 / First Half of 2026
TE CSE AIML/ Semester – VI / Cloud Computing/ Academic Year: 2025-26 / First Half of 2026