Load Balancing and Auto Scaling
Build an Application Load Balancer backed by an Auto Scaling Group using Launch Templates, configure CPU-based scaling policies, and verify that the group replaces an unhealthy instance automatically.
Prerequisites: An AWS account, AWS CLI v2 configured, the VPC and subnets from the EC2 and VPC project (or a VPC with at least two public subnets in different AZs).
An Application Load Balancer (ALB) is a Layer-7 load balancer — it understands HTTP/HTTPS and can route based on path, hostname, headers, and more. Combined with an Auto Scaling Group, you get a system that handles variable load (the ASG adds/removes instances based on demand) and self-heals (the ASG replaces instances the ALB health check marks unhealthy). This combination is the backbone of most stateless web application architectures on AWS.
The correct API sequence matters here: create the target group first, then the ALB and listener pointing at it, then the ASG with the target group ARN. This is the order AWS's own official tutorial follows.
Create a Launch Template
Create Target Group, ALB, and Listener
Create the Auto Scaling Group and attach it to the target group
Add CPU-based scaling policy
Secret Mission: Simulate and observe a failure
Before You Go
Test what you just learned
Self-testing is one of the best ways to retain new skills. Unlock project quizzes to check your understanding.
Log in to unlock0 / 7 complete
