This lab walks you through the steps to create an Application Load Balancer from AWS CLI.
You will practice using AWS EC2 and AWS Load Balancers.
Duration: 1 hour
AWS Region: US East (N. Virginia) us-east-1
Elastic Load Balancer is used to manage load balancing between multiple EC2 instances across in multiple availability zones on AWS.
It distributes the load across specified targets.
It enables us to have increased availability of the application in multiple availability zones.
It’s a fully managed service that can distribute incoming traffic to AWS resources in different availability zones.
It monitors the health of the targets and routes traffic accordingly to the healthy targets.
The load balancer can accept incoming traffic by configuring listeners with a protocol and port number.
The target group can be configured with a protocol and port number to route the traffic to that particular target only if the target's health is healthy.
Elastic load balancer supports scaling, which can be done automatically as the traffic to the application changes.
Modification of targets from the load balancer can be done without disturbing the other requests at any point in time.
AWS Elastic Load balancers support 3 types of load balancing, namely:
Classic Load Balancer: Routing and load balancing decisions are taken at the transport layer or the application layer. It supports EC2-classic and VPC.
Network Load Balancer: Routing and load balancing decisions is taken at the transport layer. It's used for applications that need high availability and performance.
Application Load Balancer: Routing and load balancing decisions is taken at the application layer.
Application Load Balancer is used for applications that need advanced functionality and application-level support.
It works at the application layer which is layer 7 in the OSI model.
It supports protocols such as HTTP and HTTPS only.
The application load balancer has target groups that will have registered targets such as EC2 instances.
The application load balancer routes the traffic to the specific target based on rules, even though the contents of the target instances are different.
The application load balancer acts as a one-point contact, which manages the incoming traffic.
The connection requests to the instances are managed by the load balancer with the help of listeners.
The listeners are configured with protocol and port numbers and the listeners are also configured with rules to route the traffic to the registered targets.
The listener should have a default rule so that the incoming requests are routed there by default. Other rules can be configured with suitable actions for the conditions and priority.
When the incoming request matches the condition set in the listener rule, the load balancer routes the request to that particular target group.
The target group routes the request to the registered target’s EC2 instance using the protocol and port number.
A target can be registered with multiple target groups and health check configurations can be done separately.
Health checks are done based on the listener rule for all the targets.
Once the load balancer receives the request, it checks the listener rules based on its priority order and decides which rule to apply.
According to the rule it finds, it selects the targets from the target group.
Listener rules can be also configured to route traffic to the target groups based on the content of the application traffic.
Log into AWS Management Console.
Creating EC2 Instance.
Creating another EC2 Instance.
Creating an Application Load Balancer in AWS CLI.
Creating a Load Balancer.
Creating 2 Target Groups.
Register the Targets with their Respective Target groups.
Creating Listener Default Rules.
Creating Listeners for other rules.
Verifying the health of the Target Groups.
Verifying the Load balancer rules by accessing the DNS.
Validation of the lab.
Deleting AWS Resources.