Day 24: Setting Up an Application Load Balancer for an EC2 Instance
Hi! Join me doing this 100 days of Cloud (AWS). Here’s the link: https://engineer.kodekloud.com/signup?referral=672847e178f19b9ad872e222
Day 24: Setting Up an Application Load Balancer for an EC2 Instance
Hi! Join me doing this 100 days of Cloud (AWS). Here’s the link: https://engineer.kodekloud.com/signup?referral=672847e178f19b9ad872e222
Purpose
To configure an Application Load Balancer (ALB) in front of an EC2 instance running Nginx, enabling public HTTP access and proper traffic routing.
Architecture
Client (Internet)
│
▼
Application Load Balancer (devops-alb)
│
▼
Target Group (devops-tg)
│
▼
EC2 Instance (devops-ec2 running Nginx)
Create Security Group for ALB
- Go to EC2 Dashboard → Security Groups
- Click Create Security Group
- Configure:
- Name:
nautilus-sg - Description: Allow HTTP access
- Inbound Rules:
- Type: HTTP
- Port: 80
- Source:
0.0.0.0/0(public access)

Create Target Group
- Go to EC2 Dashboard → Target Groups
- Click Create Target Group
- Configure:
- Target type: Instances
- Name:
nautilus-tg - Protocol: HTTP
- Port: 80
-
Click Next
-
Register targets:
- Select
nautilus-ec2 - Click Include as pending below

Create Application Load Balancer
- Go to EC2 Dashboard → Load Balancers
- Click Create Load Balancer → Application Load Balancer
- Configure:
- Name:
nautilus-alb - Scheme: Internet-facing
- IP type: IPv4
- Listeners: HTTP (Port 80)
- Select:
- VPC: Same as EC2
- Subnets: At least 2 public subnets same as EC2
- Under Security Groups:
- Attach
nautilus-sg
- Under Listeners and Routing:
- Forward to
nautilus-tg


Verify EC2 Security Group
- Go to EC2 → Instances → nautilus-ec2
- Check attached Security Group
- Ensure Inbound Rule exists:
- Type: HTTP
- Port: 80
- Source:
0.0.0.0/0OR ALB security group (nautilus-sg)

Validate Setup
- Copy ALB DNS Name
http://nautilus-alb-901417625.us-east-1.elb.amazonaws.com/
-
Open in browser:
-
Expected result:
- Nginx default page is displayed

Insights:
Application Load Balancer (ALB) is used to route user requests to healthy servers.
In this lab, only one EC2 instance is used, so the ALB simply forwards traffic to that single server. However, the ALB’s DNS name is still used as the main entry point (front door) for users.
This setup is important because:
- Additional EC2 instances can be added later without changing the DNS
- The ALB automatically distributes traffic to healthy instances
- Users will not experience downtime during scaling or instance failure, since traffic is redirected to available servers
메타데이터
- post_id
- fed31fd6eefe
- slug
- day-24-setting-up-an-application-load-balancer-for-an-ec2-instance-fed31fd6eefe
- url
- https://medium.com/@rheamae.b.acc/day-24-setting-up-an-application-load-balancer-for-an-ec2-instance-fed31fd6eefe
- canonical_url
- https://medium.com/@rheamae.b.acc/day-24-setting-up-an-application-load-balancer-for-an-ec2-instance-fed31fd6eefe
- author_url
- https://medium.com/@rheamae.b.acc
- status
- ok
- fetched_at
- 2026-06-09 15:37:30