AWS Elastic Beanstalk

Part 1: What is Elastic Beanstalk and its concepts.

Dang Nguyen
4 min readOct 5, 2020

What is Elastic Beanstalk?

Elastic Beanstalk is a Platform as a Service (PaaS). With Elastic Beanstalk, you can quickly deploy and manage applications in AWS Cloud without having to learn about the infrastructure that runs those applications.

Elastic Beanstalk handles details of capacity provisioning, load balancing, auto scaling and health monitoring automatically.

Elastic Beanstalk supports applications developed in Go, Java, .NET, PHP, Nodejs, Pythod and Ruby.

Pricing

The cool thing is you don’t have to charge any addition fee when using Elastic Beanstalk, you pay only for resources that your applications consumes.

Elastic Beanstalk concepts

Here are some keys Elastic Beanstalk concepts:

Application

In Elastic Beanstalk, an application conceptually similar to a folder.

An Elastic Beanstalk application is a logical collection of Elastic Beanstalk components, including environments, versions, and environment configuration.

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 S3 object that contains deployable code, such as a Java WAR file.

You can deploy any version you already uploaded to application.

Environment

An environment is a collection of resources running an application version. Each environment runs only one application version at a time, however, you can run the same or difference application versions in many environments simultaneously.

So that you can run multiple environments on a single application: development environment, testing environment, or production environment.

Environment tier

When you launch a Elastic Beanstalk environment, you first choose an environment tier. It’s 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 SQS queue runs in a worker environment tier

  1. Web server environment
AWS resources created for a web server environment include one elastic load balancer, an Auto Scaling group, and one or more Amazon EC2 instances.

Every web server environment has a CNAME (URL) that points to a load balancer. This URL is aliased in Amazon Route 53 to an Elastic Load Balancing URL by using a CNAME record.

The load balancer sits in front of the EC2 instances, which are apart of Auto Scaling group. EC2 Auto Scaling automatically starts addition EC2 instances to accommodate increasing load on your application.

Software stack running on 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, a environment with Apache Tomcat container uses Amazon Linux OS, Apache web server and Apache Tomcat software. In addition a software component called host manager (HM) runs on each EC2 instance. The host manager responsible for the following:

  • Deploying application
  • Aggregating events and metrics for retrieval via console, the API, or command line
  • Generating instance-level events
  • Monitoring the application log files for critical errors
  • Monitoring the application server
  • Patching instance components
  • Rotating your application log files and publishing them to S3

2. Worker environment

AWS resources created for a worker environment tier include an Auto Scaling group, one or more EC2 instances, and an IAM role.

For worker environment tier, Elastic Beanstalk also creates and provisions an SQS queue if you don’t already have one.

When you launch a worker environment, Elastic Beanstalk installs the necessary support files for your programming language of choice and a daemon on each EC2 instance in the Auto Scaling group. The daemon reads messages from SQS queue and sends data from each message to web application running in the working environment for processing.

Amazon Cloud Watch is used for alarms and health monitoring.

For details about how the worker environment tier works, see Elastic Beanstalk worker environment.

Environment configuration

An Environment configuration identifies a collection of parameters and settings that define how an environment and its associated resources behave.

Saved configuration

A saved configuration is a template that you can you at staring point for creating a unique configuration. You can create and modify saved configurations, and apply them to environments using Elastic Beanstalk console, EB CLI, AWS CLI, or API.

Platform

A platform is a combination of an operation system, programming language runtime, web server, application server, and Elastic Beanstalk components. You can design and target your web application to a platform. Elastic Beanstalk provide a variety of platform on which you can build your application.

Elastic Beanstalk platforms glossary

Please refers to AWS document below to understand key terms related to Elastic Beanstalk platforms and their lifecycle:

https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/platforms-glossary.html

Shared responsibility model for Elastic Beanstalk platform maintenance

AWS and their customers share responsibility for achieving a high-level of software components and compliance. For details, see:

https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/platforms-shared-responsibility.html

--

--