Blog Amazon Web Services Deployment with Elastic Beanstalk
Deployment with Elastic Beanstalk

Deployment with Elastic Beanstalk

Exam Objective

“Elastic Beanstalk” addresses the Continuous Delivery and Process Automation topic as highlighted in the AWS Blueprint for the exam guide –

Get AWS DevOps Engineer Professional Certification Today!

Elastic Beanstalk is a service that allows one to quickly provision environments. It is preferably good for developers who need to get environments up and to run for their code. The Elastic Beanstalk environment currently supports the following programming languages and environments:

  • Packer Builder
  • Single Container Docker
  • Multicontainer Docker
  • Preconfigured Docker
  • Go
  • Java SE
  • Java with Tomcat
  • .NET on Windows Server with IIS
  • Node.js
  • PHP
  • Python
  • Ruby

How does the Elastic Beanstalk Environment Operate?

The below diagram from AWS shows the basic structure of Elastic beanstalk workflow.

Elastic Beanstalk Environment

1) First, you create your application. (You can have multiple applications defined in Elastic Beanstalk.)

2) Next, you define environments so that you can define multiple environments for your application. You can have a development, staging, and production environment created separately for your application.

3) Then, you deploy your application to the environment.

Types of Environments

There are two types of environments –

Web Environment – An environment tier where the web application processes web requests, is known as a web server tier.

Worker Environment – An environment tier where web application runs background jobs is known as a worker tier.

Implementing Elastic Beanstalk Environments and Applications

Now let’s have a closer look at how we can work with the Elastic Beanstalk environment.

Step 1) Log into your AWS Console. Go to the Compute->Elastic Beanstalk

Elastic Beanstalk

Step 2) The first step is to create a new application.

Creating New Application in Beanstalk

Step 3) Once the application is created, you need to create the environment.

Beanstalk Environment

Step 4) Choose the type of environment – In our case we will choose the Web server environment.

Web Server Environment

Step 5) Next decide the domain for the application


Step 6) Next choose the type of platform required. For the purpose of our demo, we will create a Tomcat platform which can be used to host HTML pages.

AWS Elastic Beanstalk

Step 7) Then choose to upload your code

Beanstalk Application

When uploading the code, ensure to give a proper name to the Application version. You can choose an S3 URL for your code or choose a zip file for your code.

In our example, we have zipped a file called Demo.html and uploaded that file as an application.

Amazon S3

Now once the environment has been created and you browse to the provided elastic beanstalk URL and browse to the Demo.html file, you will get the below output.

Step 8) if you want to deploy another version of your application, you can carry the following steps

a) First, go to your application and choose ‘Application versions’

Elastic Beanstalk Applications

b) Choose the Upload option to upload a new version of your file. Give a version label and upload the application as a zip file. In our example, we have just made a change to the Demo.html file and uploaded it as a zip file.

Beanstalk Demo

Finally, click the Upload button.

c) Now when the file has been uploaded, it’s time to deploy the application.

Choose NewAppv1 version and click on the Deploy button.

Beanstalk Application Version

Then it will ask you the environment where you need to deploy your file. Here you can choose any environment. We will choose our Demo-env environment.

Beanstalk Environment

Then click on the Deploy button.

Once the code has been deployed, you can see the running version in the Environment section. So go to your environment, and you will now see the NewAppv1 version running.

Beanstalk Deployment

If you go to another tab and browse the Demo.html file, you will be able to see the new code.

Elastic Beanstalk

Final Points to Remember

  1. Elastic Beanstalk takes care of provisioning all the infrastructure required for deploying your development and test applications. It can be used to get development teams up and running in no time with their application code.
  2. Elastic Beanstalk supports a variety of programming languages such as Java, PHP, DotNet, Node.js, Python, and Ruby.
  3. You can deploy custom code at any point in time in Elastic Beanstalk.
  4. Every environment has a CNAME (URL) that points to a load balancer. The load balancer sits in front of the Amazon EC2 instances, which are part of an Auto Scaling group. The software stack running on the Amazon EC2 instances is dependent on the container type. A container type defines the infrastructure topology and software stack to be used for that environment. For example, an Elastic Beanstalk environment with an Apache Tomcat container uses the Amazon Linux operating system, Apache web server, and Apache Tomcat software.

[divider /]

Whizlabs AWS DevOps Engineer Professional Practice Tests help students to get mentally prepared for the actual certification exam. Practicing several times through AWS mock tests before the certification exam, makes you better prepared for the real one.

About Pavan Gumaste

Pavan Rao is a programmer / Developer by Profession and Cloud Computing Professional by choice with in-depth knowledge in AWS, Azure, Google Cloud Platform. He helps the organisation figure out what to build, ensure successful delivery, and incorporate user learning to improve the strategy and product further.


Please enter your comment!
Please enter your name here