Auto Scaling Group (ASG)
Maintains application availability and fault tolerance by dynamically provisioning EC2 instances across multiple Availability Zones, integrating with Elastic Load Balancing target groups, and enforcing automated lifecycle termination policies.
AWS Container Placement
VPC, SUBNET
Summary
Automatically adjusts compute capacity by launching or terminating EC2 instances according to demand spikes, schedules, and health status.
When to Use (SAA-C03)
Use instead of standalone EC2 instances for production web/API tiers; set minCapacity >= 2 across 2+ AZs for high availability.
Allowed Ingress Connections & Ports
| Source Service | Protocol | Port | Architectural Rationale |
|---|---|---|---|
| ALB | TCP / HTTP | 80, 443, 8080 | Application Load Balancer health checks and forwarded client traffic distributed to target group members |
| NLB | TCP | Any TCP Port (e.g. 80, 443, 8443) | Network Load Balancer ultra-high throughput Layer 4 passthrough traffic |
| WEBCLIENT | TCP | 80, 443 | Direct public internet traffic if instances are provisioned in public subnets with auto-assigned public IPs |
| ADMINCLIENT | TCP | 22 (SSH) | Secure shell bastion host access for maintenance and debugging |
Allowed Egress Targets & Ports
| Target Service | Protocol | Port | Data Flow Rationale |
|---|---|---|---|
| RDS | TCP | 3306 (MySQL/Aurora), 5432 (PostgreSQL) | Database transactions and persistent data store queries |
| ELASTICACHE | TCP | 6379 (Redis), 11211 (Memcached) | Sub-millisecond low latency caching layer for session state and hot data |
| DYNAMODB | HTTPS | 443 | Direct NoSQL queries via regional endpoint or DynamoDB Gateway VPC Endpoint |
| S3 | HTTPS | 443 | Static assets, application logs, and data lake storage via S3 Gateway VPC Endpoint |
| NAT | TCP | 80, 443 | Outbound internet traffic through NAT Gateway for OS security patches, packages, and third-party APIs |
Key Configuration Parameters & AWS Best Practices
| Parameter | Format / Example | Purpose & Rationale |
|---|---|---|
| Minimum Size (asgMin) (Required) | 2 | The lower bound on the number of running EC2 instances the group will maintain during quiet periods or scale-in events. Why: Guarantees baseline capacity and service availability even when traffic reaches near-zero levels. |
| Desired Capacity (asgDesired) (Required) | 2 | The target number of EC2 instances the group actively maintains under normal operating load. Why: ASG automatically provisions or terminates instances to match this target capacity unless scaled by scaling policies. |
| Maximum Size (asgMax) (Required) | 6 | The upper ceiling on the number of instances the ASG is permitted to scale out to during traffic surges. Why: Prevents runaway compute costs, protects downstream database connection limits, and caps blast radius during DDoS spikes. |
| VPC Subnets (asgSubnetIds) (Required) | [subnet-us-east-1a, subnet-us-east-1b] | A list of private or public subnets across 2 or more Availability Zones where ASG launches worker instances. Why: Mandatory for high availability: AWS spreads instances evenly across the specified AZs to survive single-datacenter disruptions. |
| Launch Template ID (launchTemplateId) (Required) | lt-0123456789abcdef0:1 | The configuration template specifying AMI ID, instance type, key pair, security groups, block devices, and user data bootstrap script. Why: Replaces deprecated Launch Configurations; defines exact hardware and OS blueprint for all spawned instances. |
| Capacity Units per Instance (asgCapacityPerInstance) | 100 | Estimated request processing capacity or throughput handled per individual EC2 instance in the fleet. Why: Used by predictive scaling algorithms and CloudTracer load-testing simulation to determine when to trigger scale-out. |
| Target Group Attachments (targetGroupArns) | [arn:aws:elasticloadbalancing:...:targetgroup/web-tg/...] | Target group(s) where new EC2 instances automatically register on launch and deregister before draining. Why: Directly integrates compute elasticity with Application Load Balancer traffic routing and connection draining. |
| Scaling Policy Type (asgScalingPolicyType) | target-tracking | The dynamic scaling policy used to automatically adjust group capacity based on live CloudWatch metrics. Why: Target Tracking policies maintain an average CPU utilization (e.g. 70%) or ALB request count per target automatically. |
| Target CPU Utilization (asgTargetCpuPercent) | 70 | The target average CPU utilization percentage the target tracking policy seeks to maintain across the fleet. Why: Triggers scale-out alarms when metric exceeds threshold, and scale-in when load subsides. |
| Health Check Type | ELB | Determines whether instance health is evaluated strictly via hypervisor status checks (EC2) or includes ALB target group HTTP health checks (ELB). Why: ELB health checks ensure that instances with crashing web processes or dead ports are replaced even if the OS kernel is alive. |
Practice Labs Using Auto Scaling Group
Streaming Media Platform: ASG Max Capacity Bottleneck
Increase ASG maximum capacity to at least 6 to absorb live traffic surges.…
SAA-08Multi-Tier Highly Available Web Architecture: Dual-AZ ALB, ASG Fleet & Multi-AZ RDS
Re-architect for multi-AZ high availability: map the public ALB across dual AZs (us-east-1a and us-east-1b), d…
SAA-10Non-Prod Fleet: Multi-AZ NAT & On-Demand Compute Overspend
Consolidate staging egress to a single NAT Gateway, update private route tables to route through the single NA…
Frequently Asked Questions
Where does Auto Scaling Group live inside an AWS VPC architecture?
Valid container placement: VPC, SUBNET. Maintains application availability and fault tolerance by dynamically provisioning EC2 instances across multiple Availability Zones, integrating with Elastic Load Balancing target groups, and enforcing automated lifecycle termination policies.
When should I use Auto Scaling Group on the AWS SAA-C03 exam?
Use instead of standalone EC2 instances for production web/API tiers; set minCapacity >= 2 across 2+ AZs for high availability.
Can I simulate Auto Scaling Group packet routing without an AWS account?
Yes. CloudTracer simulates Auto Scaling Group along with 53 AWS services directly in your browser and exports production Terraform HCL.