ALB and ASG Health Check Recovery
Build an ALB-fronted Auto Scaling Group across two AZs and watch the ASG self-heal when an instance fails its ELB health check.

Lab Overview
In this lab you'll build a small but realistic web tier in your TeKanAid AWS lab account: an Application Load Balancer fronting an Auto Scaling Group that spans two Availability Zones. You'll then break one instance on purpose to prove that ELB health checks and ASG instance replacement work end-to-end.
You will:
- Create a VPC, two public subnets in two AZs, security groups, an ALB, and a target group with an HTTP `/healthz` health check
- Build a launch template (t3.small, Amazon Linux 2023, nginx via user-data) and an Auto Scaling Group attached to the target group
- Configure the ASG with `HealthCheckType=ELB` and `HealthCheckGracePeriod=180` so the ASG trusts the ALB's health check verdict
- Verify all targets reach `healthy` and confirm traffic flows through the ALB DNS name
- Use SSM Session Manager to terminate nginx on one instance, observe the ALB mark it unhealthy, and watch the ASG terminate and replace it automatically
The whole exercise is driven from the AWS CLI on the workstation. Every task is idempotent and produces files in `/root/alb-asg/` that the next task reads.
What You'll Learn
Provision an ALB, target group, and security groups in a multi-AZ VPC using the AWS CLI
Author a launch template that bootstraps nginx with a /healthz endpoint via user-data
Create an Auto Scaling Group attached to an ALB target group with HealthCheckType=ELB
Validate that traffic flows through the ALB DNS name across both AZs
Demonstrate ASG self-healing by failing an instance's ELB health check and observing automatic replacement
Prerequisites
aws-cli-familiarity
vpc-and-ec2-basics
aws-associate-level-knowledge
Technologies Covered
Part of a Course
This lab is part of the AWS Certified DevOps Engineer - Professional (DOP-C02) course
View All CoursesChoose your plan
Simple, Transparent Pricing
Unlock full access to TeKanAid courses, labs, and bootcamps
Pro
Course content without labs
Renews automatically. Cancel anytime.
Final price verified at checkout.
- Full access to all courses
- Progress tracking
- Certificate of completion
- Community access
- Bootcamp participation
- New content access
Premium
Full access with hands-on labs
Renews automatically. Cancel anytime.
Final price verified at checkout.
- Everything in Pro
- Unlimited hands-on labs
- Lab AI Assistant
- Accelerator bootcamps with live office hours
- Priority support
Prefer a single course?
Purchase individual courses for a one-time fee of $79. Full access to course content, quizzes, certificates, and community features, lab access is not included.
Browse CoursesTry it free, no credit card
Three free ways to start. All bridge into the paid Premium catalog when you're ready.
Not ready to commit? The crash course is email-only. No academy account required.
Ready to Get Started?
Start this hands-on lab and build real-world Platform Engineering skills
Get Access Now