AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips

AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips

AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips

Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips

What is a Load Balancer in AWS?
"A load balancer distributes incoming application traffic across multiple EC2 instances in multiple Availability Zones."

How many types of Load Balancer AWS Supports?

Aws supports three types of load balancer -
  • Classic load balancer
  • Application load balancer
  • Network load balancer

Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips

Common features supported -

Below are the few common features supported among the load balancers in AWS 

Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips

Application Load Balancer in AWS -

"Application Load Balancer operates at the request level (layer 7), routing traffic to targets – EC2 instances, containers, IP addresses, and Lambda functions based on the content of the request."
  • Newer load balancer
  • AWS recommends using ALB instead of CLB.
    Features provided by ALB in AWS - 
    • Layer-7 Load Balancing
    • HTTPS Support
    • Server Name Indication (SNI)
    • IP addresses as Targets
    • Lambda functions as Targets
    • High Availability
    • Security Features
    • Content-based Routing - ( Host, Path, HTTP header, HTTP Method, Query-String parameter, Source IP address CIDR )
    • Containerized Application Support
    • HTTP/2 Support
    • WebSockets Support
    • Native IPv6 Support
    • Sticky Sessions
    • Delete Protection
    • Request Tracing (Application Load Balancer injects a new custom identifier “X-Amzn-Trace-Id” HTTP header on all requests coming into the load balancer.)
    • Web Application Firewall
    • Slow Start Mode with Load-Balancing Algorithm
    • User Authentication
    • Redirects
    • Fixed Response 
 Please refer to AWS ALB documentation for more info

Classic Load Balancer in AWS - 

"Classic Load Balancer provides basic load balancing across multiple Amazon EC2 instances and operates at both the request level and connection level."

   Features provided by ALB in AWS - 
    • High Availability
    • Sticky Sessions
    • IPv6 Support
    • Layer 4 or Layer 7 Load Balancing
 Please refer to AWS CLB documentation for more info


ELB Hands-On

How to deploy Classic Load Balancer in AWS?  

1. Go to EC2 Dashboard - Click on Launch Instances.

Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips

2. Select the Free Tier Eligible (AMI and Storage).
Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips
Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips
Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips

3. Fill the below User Data Script and Select the different subnet for each EC2 instance.
                               Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips
Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips

4. Click the launch instances ( Blue Button )
Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips

5. In order to launch similar instances - 
  • Click on Actions --> Launch more like this.
  • Change Subnet --> In order to launch to maintain high availability. 
Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips

6. Create two security group one for the load balancer and one for EC2 instances
  • In order to make infrastructure more secure, we need to restrict our EC2 from the inbound sources.
  • Route all inbound sources from the ELB to the EC2 instances.
                                                               EC2 Security Group
  
                                      Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips
Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips

ELB Security Group

Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips
Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips

7. Select the Create Load Balancer

Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips
8. Press Create for Classic Load Balancer.
Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips
9. Choose Name and Select more than one subnet for high availability.

Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips

10. Assign the ELB Security group that we have created in Step 6.


Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips
11. Ignore Configure Security Settings as we are not using any https ( SSL Certificate )
Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips
12. Configure the ping path ( either / or /index.html ) preferred (/) and tweak the advanced details as per choice.
Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips
13. Add the EC2 instance that we have created in the above steps and add the tags for costing/reference purposes.
Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips

Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips
14. Press Create for the successful creation of a load balancer.
Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips

Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips
15. Initially the instance will show - ( Out of Service ) as a health check will be in progress. After a few seconds, instances will be in service.

Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips

Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips
16. Copy the DNS to check whether ELB is working or not.

Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips
17. Hurray !!!! Our ELB is working fine. 

Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips
18. In order to enable the stickiness ( retains the cookies or session for a few minutes ). Put the time period in how many seconds want to retain the stickiness.
Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips

Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips

How to deploy Application Load Balancer in AWS?  



1. Go to Load Balancer and Select Application Load Balancer  - Click Create



2. Most of the steps are the same as Classic Load Balancer - Only a few configuration changes need to be taken care such as - Configure Load Balancer ( Step 1)  where we need to select scheme, Listeners, and Availability Zones ( Select at least more than 2 for high availability).

Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips

3. Step 2 and Step 3 are related to the security groups similar to the Classic Load Balancer.

4. Configure Routing in which we need to create a new target group ( target group is used to deploy microservices, we can different target groups for different applications and attach to a single application load balancer that can be identified using the routing method ) and configure the health checks. 

Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips

5. Step 5 ( Registered Targets ) - adding instances to the target group.

Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips
6. Successful creation of Load Balancer.

Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips

7. Copy the DNS and Check whether it is working.

Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips

8. Add listeners for HTTPS and SSL certificate using ACM or upload your own certificate. 

Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips

9. In order to create a new target group, there is a different panel for that below load balancer tab click on it - Click on Create Target Group.

Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips

Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips

10. For enabling stickiness and adding more instances - all changes need to be configured in respective target groups.

Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips

Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips

11. Load Balancer is working fine. 

Day 2 - AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips


AWS Study Combo Pack -


Click here  AWS Study Material

0 Response to "AWS Elastic Load Balancer Zero to Hero | AWS VPC | Hands-on | Certification Tips"

Post a Comment

Hey Random,

Please let me know if you have any query :)

Adsense

Adsense

Adsense

Adsense