AWS 101: How to choose correct Infrastructure and Intro to  Elastic Beanstalk

AWS 101: How to choose correct Infrastructure and Intro to Elastic Beanstalk

How to choose correct Infrastructure, Introduction to the launch of Beanstalk and getting hands on Beanstalk

What is AWS?

Amazon Web Services (AWS) is the world’s most comprehensive and broadly adopted cloud platform, offering over 200 fully featured services from data centres globally. Millions of customers—including the fastest-growing startups, largest enterprises, and leading government agencies—are using AWS to lower costs, become more agile, and innovate faster.

I assume that If you are here you are already knowing the basics about the AWS, but if you are new to the AWS I will highly recommend you to go through my previous article listed below which would cover your basics to the AWS and the Introduction to the IAM Groups, Deploying the EC2 instances which are considered to be the stepping stones to the world of AWS.

AWS Introduction and IAM Service

Introduction to EC2 Service

Also you could checkout my series for a Newbie DevOps Engineers any DevOps Enthusiast.

Every DevOps Novice must know

Also before getting started with the Beanstalk first let us understand How to choose the right Infrastructure.

How to choose the right Infrastructure ?

There are different factors to take into account when deciding which service to use to deploy your first web application on the AWS Cloud. You should consider if you want a managed infrastructure with low stress, if you need containers (and why) or if you want full control and customization. Let's get started!

Option 1 : Write code and deploy automatically, let the AWS take care of Infrastructure

  • Integrate with CD, build and deploy automatically. Never worry about configuration of the underlying services

  • Use vanilla JavaScript, or any JS framework, or write your own code with Java, .NET, Go, Ruby, PHP, and Python

  • An easy and quick way to deploy.

For the above purposes AWS has proposed the services like AWS Amplify and the AWS Elastic Beanstalk which serves the purpose.

When to use the AWS Amplify ?

These are generally used when we want to build and deploy the webapp using Js and Js Frameworks like React, Angular, Vue, NextJs with the following properties.

  • If we want the Built-in configuration to leverage back-end services
  • Globally scalable, fully managed infrastructure
  • Easiest and fastest way to deploy a web application

When to use Elastic BeanStalk ?

These are generally used when user wants to upload their code, AWS handles everything from capacity provisioning, load balancing, auto-scaling to application health monitoring with the following properties like

  • Widest support of back-end programming languages such as Java, .NET, Go, Ruby, PHP, Node.js, and Python
  • Globally scalable, fully managed infrastructure
  • Simple to get started, flexibility to customize

Option 2 : Build and Deploy using the Containers

They are used to build and deploy using the cloud native technologies like Docker and Kubernetes, provides the fully managed infa with the lightweight and global scalability

For such services they can be easily categorised into the AWS Lightsail, AWS ECS and AWS EKS

When to use AWS Lightsail ?

  • It is great place to learn how to use the containers.
  • If we want the completely managed infrastructure.
  • To check for the demo sample webistes and development / testing environment.
  • Most important of all use it due to the Fixed. low cost monthly pricing.

When to use AWS ECS (Elastic Container Service) ?

  • Need of global scalability, lower opertional overhead.
  • Need of the completely managed container orchestration platform.
  • Broader support for cloud native technologies such as Docker

When to use the AWS EKS (Elastic Kubernetes Service) ?

  • Needs to use the Kubernetes and have a managed control panel
  • Consistent open source APIs
  • To take advantage of other Cloud Native technologies
  • To engage with the vibrant Kubernetes community

Option 3 : Build and Deploy on a Virtual Machine

When we need to provider the highest amount of the control of the complete technology stack, for getting the full support from the underlying operating system plus custom configurations.

For such services they can be easily categorised into the AWS Lightsail, AWS EC2

When to use the AWS Lightsail?

  • Easy software choices. Choose from a curated list of Linux and Windows Operating Systems
  • Simple architectural decisions. Choose from seven different virtual machine sizes.
  • Easy integration and configuration with many AWS services.
  • Regional scalability

When to use the AWS EC2?

  • Granular control of the entire technology stack; Full integration with all AWS Services.
  • Widest availability of Operating Systems to choose from including Linux, Windows, and MacOS.
  • Widest variety of server size options, over 250 sizes
  • Global scalability

What is Elastic Beanstalk ?

Elastic Beanstalk is a service for deploying and scaling web applications and services. Upload your code and Elastic Beanstalk automatically handles the deployment—from capacity provisioning, load balancing, and auto scaling to application health monitoring.

image.png

Points to remember about AWS Elastic Beanstalk

  • It is the simplest way to deploy and scale a web app in AWS.

  • It comes under the Platform as a Service (Paas).

  • It mainly supports Java, .net, Nodejs, Tomcat, PHP, Ruby,Python and Docker etc.

  • By using the AWS Beanstalk we can have the features which get auto enabled like Auto-Load Balancer, Auto Scaling

  • We could also restrict or enable the rollouts of our webapp ie. managing the platform updates.

  • We can also manage the Health Monitoring.

  • It is a region based service

Lets get Started: To Deploy Sample Application

Now we are enough with our Getting our hands on the AWS Elastic Beanstalk. Let us try to deploy here the demo application here.

Note: It is desired for user to explore around the console and to get familiar to console.

Note: I here assume you are comfortable with browsing the AWS Console. If not not to worry. I got you covered.

Steps to Follow: Deploying

  • Search for the Elastic Beanstalk Service --> Hit on the Create Application

  • Fill-out the desired application name --> Add the desired tags --> Fill the platform of the web app that you want to deploy. (I am here going with the Nodejs Sample Application)

image.png

NOTE: It is advised that it should be done from the IAM user with the desired permission., also filling up tag information s optional but you can fill it for remembering for what purpose have we deployed the following.

  • In the Platform Branch Dropdown the desired runtime can be selected with the proper and recommend Platform versioning from the Platform version Dropdown.

  • Click on Configure More Options --> Here we can modify the presets instances, capacity, load balancers, rolling updates and deployments and much more

image.png

Note: Here we are using the preset of Single Instance as it is free tier eligible

  • We will try to modify the Capacity --> Switch it from the Single Instance to the Load Balanced

image.png

NOTE: For a Load Balancer it required at least 2 instances to distribute the load so we will mark the min Instances to 2 and for max I am here putting 3. Remember that the loadbalancers are chargeable so use it wisely.

  • If we move somewhat down we could see Scaling Triggers which we could easily trigger our custom trigger by providing out various metrics using the Metric, Statistic and Unit Drop down.

image.png

  • We will save the current changes --> Will be back on the AWS Console --> Click on Create App.

exhausted.gif

Note: It will take some time to create the app. By that time we could see the logs created in the Console terminal shown in the Environments Console.

  • By clicking on the link from the side nav Go to Environment --> It will redirect us to our newly created Nodejs sample webapp.

image.png

image.png

DO YOU REMEMBER

During setting up of our configuration we have seeted up the instances and the Load Balancers they could be seen under the EC2 Service console for the Instances and also for the Load Balancers in the Load Balancers console.

image.png

image.png

NOTE: Here the minimum number of instances are setted up and the new instance will only get created when the load to the server increases the threshold.

How to terminate the Elastic Beanstalk App ?

In the Elastic Beanstalk console window → Go to the Applications -->Delete Application

image.png

NOTE: All the related instances and load-balancers would get automatically deleted.

That was exhausting aint it ?! But worth it ;)

deadpool.gif

I hope this article has received well with all of you guys. It will definitely help you to get on and get started with the AWS Journey and I will definitely try to keep posting often and make sure that you enjoy while learning the things and getting it done.

Till then Stay tuned for the next one. I hope you are having a good day !

Every Feedback is appreciated it will help me to get better and deliver you guys a great content.

Did you find this article valuable?

Support Aditya Dhopade by becoming a sponsor. Any amount is appreciated!