Why and what
An Application Load Balancer routes HTTP/HTTPS requests to healthy targets. A target group defines target membership, protocol and health checks. An Auto Scaling Group maintains desired instance capacity using a launch template. The ALB does not automatically create capacity, and the ASG does not automatically distribute HTTP traffic without integration.
Guided lab
- Prepare an AMI or repeatable user-data script that installs a tiny web page and
/healthendpoint. Never include secrets in user data. - Create a launch template with an instance role, security group and suitable subnet-independent settings.
- Create an ASG across two AZs with minimum 1, desired 2 and a carefully bounded maximum.
- Create an internet-facing ALB using public subnets in at least two AZs. Put application instances in private subnets where feasible.
- Permit 80/443 to the ALB security group. Permit the application port on the instance SG only from the ALB SG.
- Attach the target group to the ASG, use the correct health path and allow initialization grace time.
- Browse the ALB DNS name; verify target health and instance identifiers in responses.
Scaling and availability
Target tracking can adjust capacity using CPU or request-count metrics. Choose a metric reflecting demand, a sensible warmup and capacity limits. Sticky sessions can hide shared-state problems; prefer external session/data storage when applications span instances. Store media in S3 rather than a single instance's local directory. ALB supports host/path routing; NLB operates at a different transport-oriented layer and is appropriate for other protocols/requirements. Route 53 DNS routing is not a replacement for per-request ALB routing.
Failure experiment
Terminate only one disposable ASG member and observe replacement. During a separate controlled test, make one target's health endpoint fail; observe it leave rotation. A health check that always returns 200 can conceal a broken application, while a check depending on every external service can amplify outages.
Cleanup and interview
Delete the ASG/fleet, ALB, target group and lab template versions deliberately. Explain why “two instances in the same AZ” is not the same fault isolation as two AZs, and why deployment readiness should be checked before shifting traffic.
Official references
Ravindra’s Tip
Load balancer traffic बाँटता है; Auto Scaling capacity बदलता है। एक होने से दूसरा अपने आप configure नहीं होता।
Interview and revision check
Why keep uploads out of one ASG instance's local directory?
Requests can reach another instance and instances can be replaced. Shared durable object storage avoids tying media to one ephemeral member.
Ravindra Bagale · Cloud & DevOps Academy · Handbook and project downloads