“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
- Java SE
- Java with Tomcat
- .NET on Windows Server with IIS
How does the Elastic Beanstalk Environment Operate?
The below diagram from AWS shows the basic structure of Elastic beanstalk workflow.
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
Step 2) The first step is to create a new application.
Step 3) Once the application is created, you need to create the environment.
Step 4) Choose the type of environment – In our case we will choose the 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.
Step 7) Then choose to upload your code
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.
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’
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.
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.
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.
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.
If you go to another tab and browse the Demo.html file, you will be able to see the new code.
Final Points to Remember
- 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.
- Elastic Beanstalk supports a variety of programming languages such as Java, PHP, DotNet, Node.js, Python, and Ruby.
- You can deploy custom code at any point in time in Elastic Beanstalk.
- 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.
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.
- 7 pro tips to prepare for the AZ-500: Microsoft Azure Security Technologies Exam - November 14, 2022
- Preparation Guide on DVA-C01: AWS Certified Developer Associate Exam - November 8, 2022
- Preparation Guide on SK0-005: CompTIA Server+ Certification Exam - October 26, 2022
- Free Questions on Microsoft Azure AI Solution Exam AI-102 Certification - October 14, 2022
- Preparation Guide on PAS-C01: SAP on AWS Specialty Certification Exam - October 3, 2022
- How to prepare for Microsoft Information Protection Administrator SC-400 exam? - September 21, 2022
- 25 Free Question on Microsoft Power Platform Solutions Architect (PL-600) - August 28, 2022
- All you need to know about AZ-104 Microsoft Azure Administrator Certification - August 17, 2022