Elastic Load Balancing on AWS
AWS Elastic Load Balancing distributes application’s API requests or network traffic across multiple targets located in multiple Availability Zones, scale Up & Down or In & Out based on Target Group.

What is Load Balancing?
Cloud load balancing is defined as the method of dissociating workloads and computing properties in a cloud computing environment. It enables customers to manage workload demands or application demands by distributing the compute resources among numerous computers, networks or servers.
Elastic Load Balancing
Elastic Load Balancing distributes incoming application’s API requests or network traffic across multiple targets, such as Amazon EC2 instances, containers, and IP addresses, located in multiple Availability Zones, also in different Regions. Elastic Load Balancing can scale Up/ Down or Out/ In the load balancer as traffic to your application changes over time. It can automatically fit to the vast majority of workloads.
Benefits
A load balancer distributes workloads across multiple computing resources, such as virtual servers. Using a load balancer increases the availability and fault tolerance of your applications.
You can elastically increase or decrease compute resources from your load balancer on an adhoc basis, without disrupting the overall ingress of requests to your applications.
Health checks can be configured to monitor the health of the compute resources, so that the load balancer can send requests only to the healthy ones. You can also offload the task of encryption and decryption of data in transit to your load balancer so that your compute resources can focus on their main work.
Accessing Elastic Load Balancing
You can create, access, and manage your load balancers using any of the following interfaces:
AWS Management Console— Provides a web interface to access Elastic Load Balancing.
AWS Command Line Interface (AWS CLI) — Provides commands for a broader set of AWS services, including ELB which is supported by Windows, macOS, and Linux.
AWS SDKs — Provide language-specific APIs & SDKs and can handle many of the connection details, such as calculating signatures, handling request retries, including error handling.
Query API— Provides low-level API actions that use HTTPS requests. We can access the ELB directly using the Query API. However, the Query API requires your application to handle low-level details such as generating the hash to sign the request, and error handling.
Related Services
Elastic Load Balancing works with the following services to improve the availability and scalability of your applications.
Amazon EC2 — Virtual servers used for running applications in the cloud which can be configured with load balancer for routing traffic.
Amazon EC2 Auto Scaling — Ensures your desired number of instances are running, even if an instance fails. Auto Scaling feature also enables you to automatically increase or decrease the number of instances as the demand changes. Auto Scaling enabled with Elastic Load Balancing, automatically register the instances with the group. Likewise, instances terminated by Auto Scaling are automatically deregistered from the same.
AWS Certificate Manager — Creating an HTTPS listener, you can specify certificates provided by ACM. The load balancer uses certificates to terminate connections and decrypt requests from clients.
Amazon CloudWatch — Enables you to monitor your load balancer and to take the necessary action as needed.
Amazon ECS — Enables you to run, stop, and manage Docker containers on a cluster of EC2 instances. LB can be configured to route traffic to your containers.
AWS Global Accelerator — Improves the availability and performance of your application. Accelerators are used to distribute traffic across multiple LBs in one or more AWS Regions.
Route 53 — Provides a reliable and cost-effective way to route visitors to websites by translating domain names into the numeric IP addresses. For example, it would translate www.example.com into the numeric IP address 192.0.2.1. AWS assigns URLs to your resources, such as load balancers. However, you might want a URL that is easy for users to remember. For example, you can map your domain name to a load balancer.
AWS WAF — You can use AWS WAF with your Application Load Balancer to allow or block requests based on the rules in a web access control list (web ACL).
Application Load Balancer
An Application Load Balancer functions at the application layer, the seventh layer of the Open Systems Interconnection (OSI) model. After the load balancer receives a request, it does the following:
Evaluates the listener rules in priority order to determine which rule to apply.
Selects a target from the target group for the rule action.
You can configure listener rules to route requests to different target groups based on the content of the application traffic. Routing is performed independently for each target group, even when a target is registered with multiple target groups. The default routing algorithm is round robin; alternatively, you can configure the routing algorithm used at the target group level that specifies the least outstanding requests.
You can add and remove targets from your load balancer on an ad-hoc basis, without disrupting the overall flow of requests to your application.
You can configure health checks, to monitor the health of the registered targets so that the load balancer can send requests only to the healthy targets.
ALB Hands On
Go to AWS Management Console & then go to EC2 service Dashboard.
On the Left Hand side Panel, you’ll find Load Balancers Option, as shown in the figure.
Click on Create Load Balancer.
Give a Name & select the scheme: internet-facing, as shown in the following figure.
Select the AZs (at least two), as shown in the following figure.
Configure the Security Groups by editing Inbound Rules, as shown in the following figure.
Configure Routing by giving the name to the Target Group & keep the Health Check values constant by default as shown in the following figure.
Select the Registered target i.e Instances in different AZs & click on the Add to Registered as shown in the following figure.
Check the Review & click on Create, as shown in the following figure.
Successful deployment of Application Load Balancer as shown in the following figure:
ALB resources can be viewed from Load Balancers Dashboard, as shown in the following figure.
12. Test Page for the Apache web-server through the FQDN of the Load Balancer is shown in the following figure.