aws-autoscaling
Automatically scale EC2 instance groups based on demand
TLDR
Create an Auto Scaling group with a launch template
SYNOPSIS
aws autoscaling command [options]
DESCRIPTION
aws autoscaling manages Amazon EC2 Auto Scaling groups that automatically adjust the number of EC2 instances based on demand or schedules. Groups maintain application availability and allow automatic scaling up during demand spikes and scaling down to reduce costs.
Launch templates or launch configurations define instance settings (AMI, instance type, security groups). Scaling policies determine when and how to scale based on metrics like CPU utilization or request count.
Target tracking scaling maintains a specific metric value (e.g., 50% CPU). Step scaling adjusts capacity in steps based on alarm thresholds. Scheduled scaling changes capacity at specified times.
Health checks (EC2 or ELB) detect unhealthy instances for automatic replacement. The health-check-grace-period prevents premature termination of instances still initializing.
PARAMETERS
create-auto-scaling-group
Create a new Auto Scaling groupdescribe-auto-scaling-groups
List Auto Scaling groups and their configurationupdate-auto-scaling-group
Modify group settings (capacity, health checks, etc.)delete-auto-scaling-group
Delete an Auto Scaling groupput-scaling-policy
Create or update a scaling policydescribe-scaling-activities
View scaling activity historyset-desired-capacity
Set the desired number of instancesattach-load-balancer-target-groups
Attach target groups to the groupcreate-launch-configuration
Create a launch configuration (legacy)--auto-scaling-group-name name
Name of the Auto Scaling group--launch-template spec
Launch template ID or name and version--min-size n
Minimum number of instances--max-size n
Maximum number of instances--desired-capacity n
Desired number of instances--vpc-zone-identifier subnets
Comma-separated subnet IDs--health-check-type type
EC2 or ELB health check type--health-check-grace-period seconds
Seconds before health checks start--force-delete
Delete even with running instances
CAVEATS
Launch templates are recommended over legacy launch configurations. Deleting a group with running instances requires --force-delete. Scaling activities have rate limits. Instances may take time to become healthy, affecting scaling responsiveness.
HISTORY
Amazon EC2 Auto Scaling launched in May 2009 as one of AWS's earliest services for elastic compute capacity. Originally using launch configurations, AWS introduced launch templates in 2017 for more flexibility. The service has expanded to support mixed instance types, predictive scaling, and warm pools for faster scaling.
SEE ALSO
aws(1), aws-ec2(1), aws-elbv2(1), aws-cloudwatch(1)
