Choose an Application Load Balancer when you need a flexible feature set for your applications with HTTP and HTTPS traffic. Operating at the request level, Application Load Balancers provide advanced routing and visibility features targeted at application architectures, including microservices and containers.
Prerequisite: Having a valid AWS Account (Follow the step in this link to create an AWS Account) How to Sign Up for a new Amazon Web Services Account
Open the page: https://aws.amazon.com/account/
To complete this lab, create two EC2 instances in different Availability zone
Launch instance with User data to update and configure service httpd
![](https://exceedthecloud.com/wp-content/uploads/2023/02/Picture1-9.png)
Find bellow the content of User data
#!/bin/bash
# Use this for your user data (script from top to bottom)
# install httpd (Linux 2 version)
yum update -y
yum install -y httpd
systemctl start httpd
systemctl enable httpd
echo "<h1>Hello World from $(hostname -f)</h1>" > /var/www/html/index.html
![](https://exceedthecloud.com/wp-content/uploads/2023/02/Picture2-9.png)
Confirm the creation of the 2 instances
![](https://exceedthecloud.com/wp-content/uploads/2023/02/Picture3-9.png)
First server instance
![](https://exceedthecloud.com/wp-content/uploads/2023/02/Picture4-9.png)
Second server instance
![](https://exceedthecloud.com/wp-content/uploads/2023/02/Picture5-8.png)
Create an application load balancer
Click in the menu – Load Balancers
![](https://exceedthecloud.com/wp-content/uploads/2023/02/Picture6-8.png)
Click on create load balancer
![](https://exceedthecloud.com/wp-content/uploads/2023/02/Picture7-8.png)
Choose Application Load balancer / Click on Create
![](https://exceedthecloud.com/wp-content/uploads/2023/02/Picture8-7.png)
Enter the name of the Load Balancer / Choose Internet facing
![](https://exceedthecloud.com/wp-content/uploads/2023/02/Picture9-7.png)
Choose at least two Availability Zone and one subnet per zone
![](https://exceedthecloud.com/wp-content/uploads/2023/02/Picture10-7.png)
Create a new Security Group to allow only port 80
![](https://exceedthecloud.com/wp-content/uploads/2023/02/Picture11-7.png)
Create a target group / Click on Create target group
![](https://exceedthecloud.com/wp-content/uploads/2023/02/Picture12-5.png)
Enter the Target Group name / Protocol version and health checks
![](https://exceedthecloud.com/wp-content/uploads/2023/02/Picture13-4.png)
Choose Available instances to register the target instances / Click on Create target group
![](https://exceedthecloud.com/wp-content/uploads/2023/02/Picture14-6.png)
Confirm the creation of the Target group
![](https://exceedthecloud.com/wp-content/uploads/2023/02/Picture15-4.png)
Go back and choose the newly created Target Group
![](https://exceedthecloud.com/wp-content/uploads/2023/02/Picture16-3.png)
Validate the summary and click on Create load balancer
![](https://exceedthecloud.com/wp-content/uploads/2023/02/Picture17-3.png)
Confirm the creation of your load balancer
![](https://exceedthecloud.com/wp-content/uploads/2023/02/Picture18-2.png)
![](https://exceedthecloud.com/wp-content/uploads/2023/02/Picture19-1.png)
Copy the load balancer url in a web browser to confirm you have access to your web application
![](https://exceedthecloud.com/wp-content/uploads/2023/02/Picture20-1.png)
Stop one instance and validate you still have access to your web application
![](https://exceedthecloud.com/wp-content/uploads/2023/02/Picture21-1.png)
View the health status of your target group
![](https://exceedthecloud.com/wp-content/uploads/2023/02/Picture22-1.png)
Confirm you still have access to your web application via the URL of your load balancer
![](https://exceedthecloud.com/wp-content/uploads/2023/02/Picture23-1.png)
Credit: Stephane Maarek
Leave a Reply