AWS Elastic Beanstalk

AWS Elastic Beanstalk is the fastest and simplest way to get web applications up and running on AWS.  AWS Elastic Beanstalk is an orchestration service offered by Amazon Web Services for deploying applications which orchestrates various AWS services, including EC2, S3, Simple Notification Service, CloudWatch, autoscaling, and Elastic Load Balancers. 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.

  • Elastic Beanstalk enables customers to quickly deploy and manage applications in the AWS Cloud. Once customers load any application, Elastic Beanstalk then automatically handles the details of capacity provisioning, load balancing, scaling, and application health monitoring.
  • Beanstalk enables web applications written in many popular languages and frameworks. Java, .NET, Node.js, PHP, Ruby, Python, Go, and Docker to deploy are the programming languages that customers have.
  • Customers can interact with Elastic Beanstalk using three different methods. The Elastic Beanstalk console, the AWS Command Line Interface (AWS CLI), or eb, a high-level CLI designed specifically for Elastic Beanstalk.
AWS Elastic Beanstalk

AWS Elastic Beanstalk Benefits

Elastic Beanstalk is the fastest and simplest way to deploy applications on AWS. Simply use the AWS Management Console, a Git repository, or an integrated development environment (IDE) such as Eclipse or Visual Studio to upload the application, and Elastic Beanstalk automatically handles the deployment details of capacity provisioning, load balancing, auto-scaling, and application health monitoring. 

Elastic Beanstalk automatically scales users application up and down based on the application’s specific need using easily adjustable Auto Scaling settings. Users can use CPU utilization metrics to trigger Auto Scaling actions. With Elastic Beanstalk, users application can handle peaks in workload or traffic while minimizing your costs.

Elastic Beanstalk provisions and operates the infrastructure and manages users application stack (platform). It will also keep the underlying platform running the application up-to-date with the latest patches and updates.It provision managing and configuring servers, databases, load balancers, firewalls, and networks.

Users are able use AWS resources, such as Amazon EC2 instance type, which are optimal for the application. Additionally, Elastic Beanstalk enable users to  “open the hood” and retain full control over the AWS resources powering your application. Using Elastic Beanstalk’s management capabilities, users can take over some (or all) of the elements of your infrastructure.

Elastic Beanstalk concepts

AWS Elastic Beanstalk enables users to manage all of the resources that run the application as environments. Here are some key Elastic Beanstalk concepts.

Application

An Elastic Beanstalk application is a logical collection of Elastic Beanstalk components, including environmentsversions, 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 application version is part of an application.

  • Applications can have many versions and each application version is unique. In a running environment, users can deploy any application version they already uploaded to the application, or upload and immediately deploy a new application version. 
Environment

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

  • When creating an environment, Elastic Beanstalk provisions the resources needed to run the application version users specified.
Environment tier

When launching an Elastic Beanstalk environment, first choose an environment tier. The environment 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 how an environment and its associated resources behave. When updating an environment’s configuration settings, Elastic Beanstalk automatically applies the changes to existing resources or deletes and deploys new resources.

Saved configuration

saved configuration is a template that users can use as a starting point for creating unique environment configurations. Users can create and modify saved configurations, and apply them to environments, using the Elastic Beanstalk console, EB CLI, AWS CLI, or API.

  • The API and the AWS CLI refer to saved configurations as configuration templates.
Platform

platform is a combination of an operating system, programming language runtime, web server, application server, and Elastic Beanstalk components.

  • Users can design and target a web application to a platform.
  • Elastic Beanstalk provides a variety of platforms on which users can build the applications.

Web server environments

The environment is the heart of the application. When creating an environment, Elastic Beanstalk provisions the resources required to run the application. AWS resources created for an environment include one elastic load balancer (ELB in the diagram), an Auto Scaling group, and one or more Amazon Elastic Compute Cloud (Amazon EC2) instances.

  • Every environment has a CNAME (URL) that points to a load balancer. 

The software stack running on the Amazon EC2 instances is dependent on the container type. Each Amazon EC2 instance that runs your application uses one of these container types. In addition, a software component called the host manager (HM) runs on each Amazon EC2 instance. The host manager is responsible for the following:

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

Worker environments

AWS resources created for a worker environment tier include an Auto Scaling group, one or more Amazon EC2 instances, and an IAM role. For the worker environment tier, Elastic Beanstalk also creates and provisions an Amazon 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 an Amazon SQS queue. The daemon sends data from each message that it reads to the web application running in the worker environment for processing. If you have multiple instances in your worker environment, each instance has its own daemon, but they all read from the same Amazon SQS queue.

Design considerations

Several things should be considered when designing an application: scalabilitysecuritypersistent storagefault tolerancecontent deliverysoftware updates and patching, and connectivity.

Scalability: When operating in a physical hardware environment, as opposed to a cloud environment, there are two ways to approach scalability

  1. Scale up (vertical scaling) or scale out (horizontal scaling). The scale-up approach requires an investment in powerful hardware as the demands on the business increase.
  2. Scale-out approach requires following a distributed model of investment, so hardware and application acquisitions are more targeted, data sets are federated, and design is service-oriented. 

Security: Security on AWS is a shared responsibility. AWS protects the physical resources in users environment and ensure that the cloud is a safe place to run applications. Users are responsible for the security of data coming in and out of Elastic Beanstalk environment.

Persistent storage: Elastic Beanstalk applications run on Amazon EC2 instances that have no persistent local storage. When the Amazon EC2 instances terminate, the local file system is not saved, and new Amazon EC2 instances start with a default file system.

 
 

Elastic Beanstalk Features

Users may choose to have AWS Elastic Beanstalk automatically update to the latest version of users Elastic Beanstalk environment using Managed Platform Updates. The Immutable deployment mechanism ensures these updates for new patches and minor platform versions are done in a safe manner to minimize end users impact.

  • For on-going management, users can customize application properties, create alarms, and enable e-mail notifications via Amazon Simple Notification Service.

With AWS Elastic Beanstalk, users can select the AWS resources, such as Amazon EC2 instance type including Spot instances, that are optimal for any application.

AWS Elastic Beanstalk leverages Elastic Load Balancing and Auto Scaling to automatically scale users application in and out based on their application’s specific needs. In addition, multiple availability zones give an option to improve application reliability and availability by running in more than one zone.

AWS Elastic Beanstalk provides a unified user interface to monitor and manage the health of any applications.

Application Health: Elastic Beanstalk collects 40+ key metrics and attributes to determine the health of users application. The Elastic Beanstalk Health Dashboard allows to visualize overall application health and customize application health checks, health permissions, and health reporting in one unified interface.

Monitoring, Logging, and Tracing: Elastic Beanstalk is integrated with Amazon CloudWatch and AWS X-Ray. You can leverage monitoring dashboard to view key performance metrics such as latency, CPU utilization, response codes, and set up CloudWatch alarms to get notified when metrics exceed the chosen thresholds.

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.

  • Users can choose from variety of application platforms such as Java, .NET, Node.js, PHP, Ruby, Python, Go, and Docker to deploy their web applications.

AWS Elastic Beanstalk allows users to deploy their code through the AWS Management Console, Elastic Beanstalk Command Line Interface, Visual Studio, and Eclipse. Users can pick from multiple deployment policies – all at once, rolling, rolling with an additional batch, immutable, and blue/green.

  • These policy choices enable users to choose between speed and safety of deploying an applications while reducing the administrative burden.

AWS Elastic Beanstalk leverages Elastic Load Balancing and Auto Scaling to automatically scale customers applications in and out based on their application’s specific needs. 

  • Multiple availability zones give options to improve application reliability and availability by running in more than one zone.
  • There is no additional charge for Elastic Beanstalk. You pay only for the underlying AWS resources that your application consumes.
  • Most deployment tasks, such as changing the size of the fleet of Amazon EC2 instances or monitoring an application can be perform directly from the Elastic Beanstalk web interface (console)

AWS Beanstalk platforms

AWS Elastic Beanstalk provides a variety of platforms on which users to build an applications. Users design a web application to one of these platforms, and the Elastic Beanstalk deploys the code to the platform version they selected to create an active application environment. Elastic Beanstalk provides platforms for different programming languages, application servers, and Docker containers. Some platforms have multiple concurrently-supported versions. The following are AWS Elastic Beanstalk platforms key term:

  • Runtime: The programming language-specific runtime software (framework, libraries, interpreter, vm, etc.) required to run an application code.
  • Elastic Beanstalk Components: Software components that Elastic Beanstalk adds to a platform to enable Elastic Beanstalk functionality.
  • Platform: A combination of an operating system (OS), runtime, web server, application server, and Elastic Beanstalk components. Platforms provide components that are available to run your application.
  • Platform Version: A combination of specific versions of an operating system (OS), runtime, web server, application server, and Elastic Beanstalk components. 
  • Platform Branch: A line of platform versions sharing specific (typically major) versions of some of their components, such as the operating system (OS), runtime, or Elastic Beanstalk components.
  • Platform Update: A release of new platform versions that contain updates to some components of the platform—OS, runtime, web server, application server, and Elastic Beanstalk components.
  • Managed Updates: An Elastic Beanstalk feature that automatically applies patch and minor updates to the operating system (OS), runtime, web server, application server, and Elastic Beanstalk components for an Elastic Beanstalk supported platform version. 

#01

Linux platforms

 

AWS Elastic Beanstalk provides a variety of platforms on which users can build an applications. After users designs a web application to one of these platforms, and Elastic Beanstalk deploys the code to the platform version selected to create an active application environment.

Elastic Beanstalk provides platforms for different programming languages, application servers, and Docker containers. Some platforms have multiple concurrently-supported versions.

Many of the platforms that Elastic Beanstalk supports are based on the Linux operating system (OS). Specifically, these platforms are based on Amazon Linux, a Linux distribution provided by AWS. Elastic Beanstalk Linux platforms use Amazon Elastic Compute Cloud (Amazon EC2) instances, and these instances run Amazon Linux

The Elastic Beanstalk Linux platforms provide a lot of functionality out of the box. Users can extend the platforms in several ways to support any application. 

AWS provides two versions of Amazon Linux: Amazon Linux 2 and Amazon Linux AMI. The following are the key improvements in Amazon Linux 2 compared to Amazon Linux AMI:

  • Amazon Linux 2 offers long-term support.
  • Amazon Linux 2 is available as virtual machine images for on-premises development and testing.
  • Amazon Linux 2 comes with updated components: the Linux kernel, C library, compiler, and tools. It also uses the systemd service and systems manager as opposed to System V init system in Amazon Linux AMI.
 

#02

Docker platform

 

 

Docker containers are self contained and include all the configuration information and software that a web application requires to run. All environment variables that are defined in the Elastic Beanstalk console are passed to the containers. With Docker containers, you can define your own runtime environment. Users can choose own platform, programming language, and any application dependencies (such as package managers or tools). Docker with Elastic Beanstalk  have an infrastructure that handles all the details of capacity provisioning, load balancing, scaling, and application health monitoring. 

Elastic Beanstalk can deploy a Docker image and source code to EC2 instances running the Elastic Beanstalk Docker platform. The platform offers multi-container (and single-container) support. This Amazon Linux 2 Docker platform offers the following benefits:

  • Long-term support. The Docker on Amazon Linux 2 platform has long-term support, offering security and feature updates.
  • Docker Compose features. This platform will allow users to leverage the features provided by the Docker Compose tool to define and run multiple containers, which include the docker-compose.yml file to deploy to Elastic Beanstalk.
  • Use of application images from public or private repositories. Elastic Beanstalk invokes the Docker Compose command line interface, processing the docker-compose.yml file to pull the application images and run them as containerized applications.
  • Build container images during deployment. During deployment users are able to build the container images from scratch by specifying dependencies in the Dockerfile.
 

#03

Go applications

 

AWS Elastic Beanstalk for Go is easy to deploy, manage, and scale users Go web applications using Amazon Web Services. Elastic Beanstalk for Go is available to anyone developing or hosting a web application using Go. After deploying an Elastic Beanstalk application, users can continue to use the EB CLI to manage the application and environment, or use the Elastic Beanstalk console, AWS CLI, or the APIs.

  • To get started with Go applications on AWS Elastic Beanstalk, all users need is an application source bundle to upload as the first application version, and deploy it to an environment. When creating an environment, Elastic Beanstalk allocates all of the AWS resources needed to run a highly scalable web application.

Users can use AWS Elastic Beanstalk to run, build, and configure Go-based applications. For simple Go applications, there are two ways to deploy the application:

  • Provide a source bundle with a source file at the root called application.go that contains the main package for the application. 
  • Provide a source bundle with a binary file called application. The binary file can be located either at the root of the source bundle or in the bin/ directory of the source bundle. If you place the application binary file in both locations, Elastic Beanstalk uses the file in the bin/ directory.

For more complex Go applications, there are two ways to deploy your application:

  • Provide a source bundle that includes users application source files, along with a Buildfile and a Procfile. The Buildfile includes a command to build the application, and the Procfile includes instructions to run the application.
  • Provide a source bundle that includes your application binary files, along with a Procfile. The Procfile includes instructions to run the application.
 
 

#04

Java Applications

 

AWS provides several tools for working with Java and Elastic Beanstalk. Regardless of the platform branch that users choose, which includes AWS SDK for Java to use other AWS services from within users Java application. The AWS SDK for Java is a set of libraries that allow users to use AWS APIs from their application code without writing the raw HTTP calls from scratch. AWS Elastic Beanstalk supports two platforms for Java applications.

  • Tomcat – A platform based on Apache Tomcat, an open source web container for applications that use Java servlets and JavaServer Pages (JSPs) to serve HTTP requests. Tomcat facilitates web application development by providing multithreading, declarative security configuration, and extensive customization. Elastic Beanstalk has platform branches for each of Tomcat’s current major versions

  • Java SE – A platform for applications that don’t use a web container, or use one other than Tomcat, such as Jetty or GlassFish. Users can include any library Java Archives (JARs) used by the application in the source bundle that was deployed to Elastic Beanstalk. 

The AWS Elastic Beanstalk Java SE platform is a set of platform versions for Java web applications that can run on their own from a compiled JAR file. By compiling the application locally or upload the source code with a build script to compile it on-instance. Java SE platform versions are grouped into platform branches, each of which corresponds to a major version of Java,

Get in touch

You can email us directly at :

211clouding@yahoo.com

211clouding@gmail.com

AWS Elastic Beanstalk is the fastest and simplest way to get web applications up and running on AWS.  AWS Elastic Beanstalk is an orchestration service offered by Amazon Web Services for deploying applications which orchestrates various AWS services, including EC2, S3, Simple Notification Service, CloudWatch, autoscaling, and Elastic Load Balancers. 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.

  • Elastic Beanstalk enables customers to quickly deploy and manage applications in the AWS Cloud. Once customers load any application, Elastic Beanstalk then automatically handles the details of capacity provisioning, load balancing, scaling, and application health monitoring.
  • Beanstalk enables web applications written in many popular languages and frameworks. Java, .NET, Node.js, PHP, Ruby, Python, Go, and Docker to deploy are the programming languages that customers have.
  • Customers can interact with Elastic Beanstalk using three different methods. The Elastic Beanstalk console, the AWS Command Line Interface (AWS CLI), or eb, a high-level CLI designed specifically for Elastic Beanstalk.