AWS Cloud + Deploy Web Applications in Elastic Beanstalk + Example

  • In this article we will learn how to Deploy Web Applications in Elastic Beanstalk.
  • In following flow diagram, we can see that once entire process is ready, we’ll find that we have an environment and we have sample application deployed on it.
Deploy Web Applications in Beanstalk

AWS Elastic Beanstalk? How it works?

  • Elastic Beanstalk is an easy-to-use service under Compute components for deploying and scaling web applications and services developed with Java, .NET, PHP, Node.js, Python, Ruby, Go, and Docker on familiar servers such as Apache, Nginx, Passenger, and IIS.
  • In simple words, we can upload our code and Elastic Beanstalk automatically handles the deployment, from capacity provisioning, load balancing, auto-scaling to application health monitoring. We will see in detail in this example along with screen’s snap-shots.

How does AWS Route 53 work with Elastic Beanstalk?

It is a scalable and high available DNS service which sends automated requests over the internet to a resource, such as a web server, to verify that it’s reachable, available, and functional etc.

Note : It handles DNS for both the TCP and UDP traffic requests over port 53. Hence, it is called Route 53.

How to deploy an application in Beanstalk?

Note: In order to deploy an application in Beanstalk, we need to first login to our Amazon account and we need to launch EC2 management console.

EC2 Management Console Web Page

  • Once we login with Amazon account the EC2 Management Console web page is open.
  • It is divided into two parts.
AWS Management Console
  • The first part includes the Services and Resource Groups drop-down buttons.
  • The second part is divided into two sections. The first section is the navigation pane, and the second section is the content pane. The navigation pane includes the History option. It is selected. The content pane includes the search box, the Group A-Z toggle button, and groups of services. The groups include the Compute and Storage headings. The Compute heading includes the EC2 option, and the Storage heading includes the S3 and EFS options.
AWS Management Console Compute

After launching EC2 management console, we need to select Compute group. And from Compute group, we need to select Elastic Beanstalk. We’ll click on Elastic Beanstalk.

Elastic Beanstalk Application Web Page

  • The Elastic Beanstalk Application web page opens.
  • It is divided into four parts.
  • The first part includes the Services and Resource Groups drop-down buttons.
  • The second part contains the Elastic Beanstalk and Create New Application options and the aplication1 drop-down button.
  • The third part is the navigation pane. It includes the Learn More and Featured headings. The Learn More heading includes the Modify the code option, and the Featured heading contains the Create your own custom platform option.
  • The fourth part displays the All Applications page. This page includes the Actions drop-down button.
  • Once we will have Elastic Beanstalk dashboard launched, we’ll click on Create New Application.
Elastic Beanstalk Application web page

Create Application & Environment

Example, We are entering aplication1 as Application name. Here we’ll select Node.js as platform or we can also go and select Custom platform. In case if you have written your own WAR file or ZIP file, you can select Upload your code as below. Click on Create application button.

Create New Application using elastic beanstalk

Once, we click on Create Application button, below screen will be displayed. Basically it is creating an Environment.

Create an environment using Elastic Beanstalk

See, the below alarms/steps while creating an environment named -> Aplication1-env

Create an environment using Elastic Beanstalk + CloudWatch alarm

Once, environment will be ready, sample application will be deployed in Aplication1-env.

Create an environment using Elastic Beanstalk + CloudWatch alarm

If everything goes well, we can see below screen with Health status.

Environment Health in Elastic Beanstalk

All environment will be listing out, when we will click on Environments link on left pane.

All environments in Elastic Beanstalk

Similarly, we can list out all the applications after clicking on Application link.

All applications in Elastic Beanstalk

Also, we can see all the Events generated by Aplication1-env as below along with Severity Events level. E.g. TRACE, INFO, DEBUG etc.

Events generated in Elastic Beanstalk

Create, Delete, Version, Confiuration and Restore Application Actions

We can select an applicaton from the list for Creating new application, Deleting an application, View application version, View saved configurations and Restore terminated environment actions.

Create, Delete, Version, Confiuration and Restore Application Actions

Load Configuration, Save Configuration, Swap Environment URLs, Clone Environment and Restart app server(s), Rebuild and Terminate an Environment Actions

We can select an environment from the list for Load Configuration, Save Configuration, Swap Environment URLs, Clone Environment and Restart app server(s), Rebuild and Terminate an Environment Actions. For example.

Load Configuration, Save Configuration, Swap Environment URLs, Clone Environment and Restart app server(s), Rebuild and Terminate an Environment Action

EC2 Dashboard

We can see all instances on EC2 Dashboard as below.

EC2 Dashboard

Once, we click on Instances (running), we will see instance’s detail.

EC2 Dashboard Instances (running)
EC2 Dashboard Instances (running) - details.

Note: You may play around this, we have interesting configurations and tabs to control our applications and environments monitoring over cloud.

Thank you for reading. Keep learning 🙂