By using Elastic Beanstalk we can easily manage applications in the AWS Cloud without affecting the infrastructure on the applications. With this, we can manage all of the resources that run on the application as environments. It will reduce the risks in managing applications without restricting choices and the control, as we can simply upload the applications and Beanstalk will automatically handle the load balancing, scaling, application health monitoring and capacity provisioning.
Elastic Beanstalk supports applications developed in Go, Java, .NET, Node.js, PHP, Python, and Ruby. Once the application brings into effective action, Beanstalk provides one or more AWS resources, such as Amazon EC2 instances. Beanstalk supports software stack on the Amazon EC2 instances as per the configuration on it.
Let’s take a look at an example.
If there is a Java SE platform, Elastic Beanstalk supports two configurations such as one running Java 7, and the other running Java 8. Each of them runs a software stack fitted to hosting a Java application. we can simply interact with Elastic Beanstalk by using the AWS Management Console, the AWS Command Line Interface (AWS CLI), or be, a high-level CLI designed specifically for Elastic Beanstalk.
We can change the size of our Amazon EC2 instances or monitor the application by using the Elastic Beanstalk web interface.
Application
An Elastic Beanstalk application is a logical collection of Elastic Beanstalk components.
Environment
An environment is a version that is deployed onto AWS resources.
Environment Tier
The environment tier determines whether Elastic Beanstalk provisions resources to support an application that handles HTTP requests or an application that pulls tasks from a queue.
Environment Configuration
An environment configuration identifies a collection of parameters and settings that explains how an environment and its resources behave.
Configuration Template
A configuration template is a starting point for creating unique environment configurations.
Steps to Use Elastic Beanstalk
- Create an application
- Upload an application version in the form of a Java .war file to Elastic Beanstalk
- Provide information about the application
- Beanstalk automatically launches an environment and creates and configures the AWS resources needed to run the code.
- Once the environment is launched, manage the environment and deploy new application versions.
After performing the above steps, it is available via the AWS Management Console, API’s, or Command Line Interfaces, including the unified AWS CLI.
If we need an AWS resource, we can define a template for creating AWS resources with AWS Cloud Formation, and we can use this template to launch new AWS resources without re-customizing them. Once the AWS resources are deployed, we can modify and update them in our predictable way.
After creating the Elastic Beanstalk application, we can view information about the application deployed and its provisioned resources via environment dashboard in the AWS Management Console.
To View the Dashboard
- Open the Elastic Beanstalk console.
- Choose “GettingStartedApp-env”
- On clicking next, it shows all the information about the environment. For example “URL”, “health status”, “name of the deployed application version”, “five most recent events”, and “platform configuration“.
Details of the Pages to View the State of the Environment
Configuration
The Configuration page shows the resources provisioned for this environment.
Health
The Health page shows the status and detailed health information about the EC2 instances which is running on our application.
Monitoring
We can check the following statistics for the environment:
- Average Latency
- CPU utilization.
- Can create alarms to monitor the metrics.
Events
This page shows any error and information messages.
Tags
Manage your environment’s tags
Deploy a New Application Version
The running application is labelled as “Sample Application”
- Download one of the following sample applications
~~~~
Single Container Docker – docker-single-container-v1.zip
Multi-container Docker – docker-multi-container-v2.zip
Preconfigured Docker (Glassfish) – docker-glassfish-v1.zip
Preconfigured Docker (Python 3) – docker-python-v1.zip
Preconfigured Docker (Go) – docker-golang-v1.zip
Go – go-v1.zip
Java SE – java-se-jetty-gradle-v3.zip
Tomcat – java-tomcat-v3.zip
.NET – dotnet-asp-v1.zip
Node.js – nodejs-v1.zip
PHP – PHP-v1.zip
Python – python-v1.zip
Ruby (Passenger Standalone) – ruby-passenger-v3.zip
Ruby (Puma) – ruby-puma-v3.zip
~~~~
- Open the Elastic Beanstalk console.
- On Beanstalk application page choose getting-started-app and then choose GettingStartedApp-env.
- Select Upload and Deploy.
- Click on Choose File and upload the source bundle which we have downloaded.
- The console automatically fills in the Version label.
- Select Deploy. Elastic Beanstalk now deploys the file to the Amazon EC2 instances.
To Change Your Environment Configuration
- Open the Elastic Beanstalk console.
- Direct to the management page for your environment.
- Select Configuration.
- On the Capacity configuration box, select Modify.
- Change Environment type to Load balanced, this can be done in the Scaling Group section.
- Change Max to 4, and then change Min to 2.
- Modify the capacity page, choose Save.
- Choose Apply.
- Choose Confirm.
Steps to Delete Any Unwanted Applications and Environments from Elastic Beanstalk and AWS Services
Delete all application versions.
- Open the Elastic Beanstalk console.
- Choose the getting-started-app application.
- Choose Application versions.
- Select all application versions that you want to delete, and then choose Delete.
- Confirm the versions that for deleting, and then choose Delete.
- Choose Done.
Terminate the Environment.
- Direct to environment dashboard, click getting-started-app and then click GettingStartedApp-env.
- Choose Actions, and then choose Terminate Environment.
- Confirm on terminating GettingStartedApp-env, and then choose Terminate.
Delete the Getting-Started-App Elastic Beanstalk Application.
- Direct to the main dashboard.
- Choose Actions for the getting-started-app application, and then choose Delete application.
- Confirm delete this Elastic Beanstalk application by choosing Delete.
If you require help, contact SupportPRO Server Admin