AWS Application Load Balancer

Aws Application load balancer is the service of AWS which manages the traffic to the EC2 instances according to the increasing load and scales up or down the infrastructure.
We will create the AWS ALB from the following steps :
Create the VPC named "test-vpc".
Create Internet Gateway & attach it to the VPC just created.
Create a Public subnet in the availability zone inside the VPC
Create the routing table and subnet association to the subnets just created.
Create the rule to enable internet access from "Internet Gateway" to "0.0.0.0/0"
Create the EC2 Instances in the subnet just created & assign the Public IP addresses
While creating the EC2 instances pass the User Data :
#!/bin/bash
# Update the package repository and install Apache2
apt-get update -y
apt-get install apache2 -y
# Start Apache2 service and enable it on boot
systemctl start apache2
systemctl enable apache2
# Create a custom HTML page with hostname and IP address
echo "<html><body><h1>Hostname: $(hostname)</h1><h1>IP Address: $(curl -s http://169.254.169.254/latest/meta-data/public-ipv4)</h1></body></html>" > /var/www/html/index.html
# Set permissions to ensure Apache can serve the file
chmod 644 /var/www/html/index.html
Configuring the ALB internet facing & associate it with the EC2 instances to balance load using target group
Check the ALB logs & connectivity
Here we have sucessfully configured the ALB into the AWS-VPC
Last updated