Deploying an Application Load Balancer (ALB) in AWS
In this lesson, we practiced launching an Application Load Balancer (ALB) in AWS to distribute traffic across multiple EC2 instances. Below is a structured breakdown of the process, including key concepts and step-by-step instructions.
🚀 Launching EC2 Instances
Before setting up the load balancer, we first need to create EC2 instances to handle incoming traffic.
1️⃣ Create Two EC2 Instances
- Navigate to EC2 → Launch Instances.
- Set instance count to 2.
- Name the first instance "My First Instance", and rename the second one later.
- Choose Amazon Linux 2 as the OS.
- Select t2.micro instance type.
- Skip key pair configuration (use EC2 Instance Connect instead).
- Network Settings: Select an existing security group (
Launch Wizard 1), which allows HTTP and SSH traffic.
- User Data Script: Add a script to initialize the instances upon launch.
- Click Launch and then rename the second instance to "My Second Instance".
2️⃣ Verify EC2 Instances
- Copy the IPv4 Public Address of each instance.
- Paste into a browser to confirm that each instance returns
"Hello World".
At this point, we have two running EC2 instances, each serving traffic individually.