AWS: Quick guide for Elastic Beanstalk

In this fast pace competitive market, we need to lessen the Time To Market, creating a demo application or just making a Proof of Concept by leveraging the power of cloud. As a developer we need a platform where in we could quickly build, deploy and scale our web app, mobile backend and APIs without spending time on the design and usage of the infrastructure we are going to use.
We also need to have a platform that scales well, highly available, supports multiple programming languages and different operating systems. In this quick write up I’m going to share to you one of AWS services called Elastic Beanstalk to help you leverage its features.

What is Elastic Beanstalk?

Image credit to DigitalTraining

AWS Elastic Beanstalk is one of the offerings of AWS under Platform As A Service (PAAS) that is basically a pre-configured EC2 server that can directly get your application code, environment configurations and use it as a guide to automatically generate and deploy the required resources within AWS to run either a Web Application or a worker type application. It currently supports different services developed from Java, .NET, PHP, Node.js, Python, Ruby, Go and Docker on servers such as Apache, Nginx, Passenger, and IIS.

What are the features?

Simplicity and Fast in Deployment

AWS Elastic Beanstalk is the simplest and fastest way to deploy your Application to the cloud. With a few clicks using the AWS Management console, or integrating it with Visual Studio or other supported IDEs you can quickly create the environment you need AWS to provision for you and upload your application seamlessly. You have the power to configure the capacity, auto scaling, load balancing and application health monitoring for your provisioned environment.

Scalability

Another great feature of AWS Elastic Beanstalk is the ability to scale your application up and down depending on you application specific requirements. With the wide array of monitoring tools for Elastic Beanstalk that you can use to automatically trigger scaling actions based for example on the CPU utilization or inbound/outbound network traffic in order to handle peak workload or traffic in an efficient and cost effective manner.

Developer Productivity

This a great boost for developer productivity because as mentioned before this is a managed service by AWS which means that Elastic Beanstalk is provisions and operates the infrastructure as well as manages the application stack so that you will concentrate more on the code rather than spend time on setting up the environment like configuring load balancer, databases, firewalls and networks. Another good thing is that the Elastic Beanstalk is updated with the latest patches and updates depending on the selected environment.

Complete Control Over Infrastructure

You have complete control over selecting the AWS resources like the EC2 instance type, processor type to run you Web, API or workload on. Elastic Beanstalk can be easily configured using the AWS Cloud Management Console if you decide you want to add or remove elements in your current infrastructure.

Concepts of Elastic Beanstalk

Image credits to AWS

Application: AWS Elastic Beanstalk application is a basically a logical collection of different components like environments, environment configurations and version. Think of it like the concept of Folder which is a container of different items.

Application Version: Elastic Beanstalk version is just a labelled iteration of deployable code for a your application (e.g. Web application, API).

Environment: Is a collection of AWS resources running a specific application version. So each environment runs only one application version at a time but you can run the same application version or different application versions in many environments simultaneously.

Environment Tier: When creating an Elastic Beanstalk environment you are going to choose and environment tier that designates the type of application that the environment runs, and determines what resources Elastic Beanstalk provisions to support it. Example of an Application that serves HTTP requests runs in a web server environment tier while a backend environment that pulls tasks from an Amazon SQS queue runs in a worker environment tier.

Environment Configuration: Identifies the collection of parameters and settings that define how an environment and its associate resources should behave. When you update and environment’s configuration settings, Elastic Beanstalk automatically applies the changes to existing resources or deletes and deploys new resources.

Saved Configuration: It is a template that you can use to fast track for creating your environment configurations. You can use Elastic Beanstalk console, AWS CLI, EB CLI or API to create and modify saved configuration and apply them to the environments.

Platform: Is basically a combination of an operating system, programming language runtime, web server, application server and Elastic Beanstalk components. You design and target your web application to a platform. Elastic Beanstalk provides a variety of platforms on which you can build your applications.

How does AWS Elastic Beanstalk work?

Image credits to AWS

Basically there are four steps in the workflow of Elastic Beanstalk. First is to create the application then upload an application version in the form of application code bundle which is dependent on the tech stack you are going to use. Then provide the needed information about the application like application name, platform, etc. Elastic Beanstalk will automatically launch an environment, creates the needed AWS resources to run your uploaded application code. There is the concept in DevOps called rolling deployments that is supported by Elastic Beanstalk when enabled your configuration deployments is working connected with the Auto scaling to ensure that there is a defined number instance that is always available.

Creating AWS Elastic Beanstalk Application

For this demo will create an AWS Elastic Beanstalk Application with the default sample code. So first login to your account in Amazon Cloud Console and navigate to the Elastic Beanstalk page as shown in figure 1. To start creating your AWS Elastic Beanstalk application kindly click Create Application.

Figure 1. AWS Elastic Beanstalk page.

Once you’ve clicked the Create Application you will be greeted with a simple wizard that you need to fill the needed information like the Application Name as shown in figure 2.

Figure 2. Application Name.

Next is you can optionally have application tags for your created Elastic Beanstalk so that you could easily track and manage your different environments. This is also very helpful in managing your billing statements as shown in Figure 3.

Figure 3. Application Tags.

Next is to choose the what type of platform are we going to utilize our Elastic Beanstalk. In this demo we are going to select .NET Core on Windows Server as shown in Figure 4. Take note that because .NET can already run in a Linux environment you can select it also other from the conventional windows server so that you could save money.

Figure 4. Application Platform.

Next we need to select the platform branch but because we selected earlier .NET running on Windows Server we are expecting IIS platforms as shown in Figure 5.

Figure 5. Application Supported.

Next is to select the platform version which basically is a combination of Operating System, runtime, web server, application server and Elastic Beanstalk components as shown in figure 6.

Figure 6. Platform Version.

Lastly is to either upload or use the default application from AWS to test your newly created Elastic Beanstalk but for this demo purposed will just use the default app as shown in figure 7.

Figure 7. Sample Application.

After you’ve completed all required information to create your AWS Elastic Beanstalk you could proceed with creating it which will take around few minutes which you can check on what is happening on the console as shown in figure 8.

Figure 8. Creating of AWS Elastic Beanstalk.

Once successfully created you will see in the Environment page of you Elastic Beanstalk the newly created environment as shown in Figure 9.

Figure 9. Running Elastic Beanstalk

You can validate that your web application or API is already running through the given URL by the Elastic Beanstalk as shown in Figure 10.

Figure 10. Accessing you App.

Conclusion

In this article we’ve managed to discuss what is Elastic Beanstalk, it’s simple workflow and the components. We’ve also managed to create a sample Elastic Beanstalk using the AWS cloud management console and access the running web application using the default URL from the Elastic Beanstalk. In the next series of articles that I’ll write about AWS Elastic Beanstalk I’ll teach you on how to update the sample application using our own .NET Core web under Visual Studio and several useful tools that we can use in monitoring out Elastic Beanstalk.

Happy Coding 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s