DEV Community

Cover image for πŸš€ AWS ALB Auto Scaling with CloudWatch – Real-World Architecture (Hands-On Project)
irfan pasha
irfan pasha

Posted on

πŸš€ AWS ALB Auto Scaling with CloudWatch – Real-World Architecture (Hands-On Project)

In this article, I’m sharing a real-time AWS hands-on project where I designed and implemented a highly available, auto-scaling web architecture using core AWS services.

This project helped me understand how AWS components work together in a production-style environment, not just theory.

πŸ“Œ Project Objective

The goal of this project was to:

Host a web application securely on AWS

Distribute traffic using Application Load Balancer

Automatically scale EC2 instances based on load

Monitor infrastructure using CloudWatch

Follow AWS best practices for networking and security

🧱 AWS Services Used

Amazon VPC

Public Subnets (Multi-AZ)

Internet Gateway

Route Tables

Security Groups

EC2 Instances

Application Load Balancer (ALB)

Target Groups

Auto Scaling Group (ASG)

Amazon CloudWatch

πŸ—οΈ Architecture Overview

The architecture follows a classic real-world AWS design:

A custom VPC

Two public subnets in different Availability Zones

An internet-facing ALB

Auto Scaling Group behind the ALB

CloudWatch alarms to scale instances automatically

This ensures:

High availability

Fault tolerance

Automatic scaling

Secure access

πŸͺœ Step-by-Step Implementation
1️⃣ Create Custom VPC

Created a custom VPC with IPv4 CIDR block

Enabled DNS resolution & DNS hostnames

βœ” Foundation network for the project

2️⃣ Create Public Subnets (Multi-AZ)

Created two public subnets

Each subnet placed in a different Availability Zone

βœ” Ensures high availability

3️⃣ Create and Attach Internet Gateway

Created an Internet Gateway (IGW)

Attached it to the VPC

βœ” Enables internet access

4️⃣ Configure Route Table

Created a route table

Added route 0.0.0.0/0 β†’ Internet Gateway

Associated route table with public subnets

βœ” Enables outbound internet traffic

5️⃣ Create Security Groups

ALB Security Group

Allow HTTP (80) from anywhere

EC2 Security Group

Allow HTTP (80) from ALB

Allow SSH (22) from my IP only

βœ” Follows security best practices

6️⃣ Launch EC2 Using Launch Template

Created a launch template

Added User Data to install and start web server automatically

Web page shows instance details

βœ” Enables automated instance creation

7️⃣ Create Target Group

Target type: EC2

Protocol: HTTP (80)

Health checks enabled

βœ” Ensures only healthy instances receive traffic

8️⃣ Create Application Load Balancer (ALB)

Internet-facing ALB

Associated with public subnets

Listener on port 80

Forward traffic to target group

βœ” Distributes traffic evenly

9️⃣ Create Auto Scaling Group (ASG)

Attached launch template

Attached ALB target group

Set:

Min capacity

Desired capacity

Max capacity

βœ” Automatically manages EC2 instances

πŸ”Ÿ Configure CloudWatch Alarms

Created CloudWatch alarms based on CPU Utilization

Scale-out when CPU increases

Scale-in when CPU decreases

βœ” Fully automated scaling

πŸ“Š Monitoring & Testing

Verified EC2 instances were healthy

Checked CloudWatch metrics

Accessed application via ALB DNS name

Confirmed traffic distribution

βœ” Architecture worked as expected

πŸ“Έ Screenshots (Proof of Work)

Screenshots include:

VPC & Subnets

Route Tables & IGW

Security Groups

ALB & Target Groups

Auto Scaling Group

CloudWatch Alarms

Final browser output

βœ” 100% real AWS console screenshots

βœ… Key Learnings

Through this project, I learned:

How AWS networking works in real environments

Designing scalable and fault-tolerant systems

Using ALB with Auto Scaling Groups

Monitoring and automation using CloudWatch

Following AWS security best practices

🧠 Why This Is a Real-World Project

This is not a demo or lab-only project.

It reflects:

Enterprise-style AWS architecture

Production-ready concepts

Hands-on implementation from scratch

πŸ”— GitHub Repository

πŸ“‚ Full project with screenshots & documentation:
πŸ‘‰ GitHub: https://github.com/IrfanPasha05/aws-alb-autoscaling-cloudwatch-architecture

🎯 Final Thoughts

This project boosted my confidence in AWS core services and helped me understand how scalable architectures are built in real organizations.

If you’re learning AWS or preparing for cloud roles, I highly recommend implementing this architecture hands-on.

πŸ™Œ Thanks for Reading!

If you found this helpful:

❀️ Like

πŸ’¬ Comment

πŸ” Share

Happy Learning β˜οΈπŸš€

Top comments (0)