Scaling Other Services with Application Auto Scaling
This lesson explains how many AWS services besides EC2 scale with the same policies through Application Auto Scaling, and how AWS Auto Scaling provides one place to manage scalable resources.
Learning outcomes
After completing this lesson, you will be able to:
- Register scalable targets for other services.
- Create scaling plans in the AWS Auto Scaling console.
- Troubleshoot Application Auto Scaling.
Scalable resources
Application Auto Scaling applies the same scaling model as EC2 Auto Scaling to other services. It manages a scalable target, made up of a resource ID, a scalable dimension, such as the desired task count of an ECS service or the read capacity of a DynamoDB table, and the minimum and maximum capacity. Target tracking, step and scheduled policies are then attached to the target, and the service adjusts the dimension within those limits. The following table lists resources commonly scaled this way in operations scenarios.
| Resource | Scalable dimension | Typical metric |
|---|---|---|
| ECS service | Desired task count | Average CPU, memory, ALBRequestCountPerTarget |
| DynamoDB table and GSI | Read and write capacity units | Consumed capacity utilisation |
| Aurora cluster | Number of Aurora Replicas | Average reader CPU or connections |
| Lambda alias or version | Provisioned concurrency | Provisioned concurrency utilisation |
| ElastiCache replication group | Shards or replicas | Engine CPU, memory |
| Spot Fleet | Target capacity | Average CPU |
The following diagram shows a scalable target for an ECS service with two policies.

Which scaling service?
AWS Auto Scaling console
The AWS Auto Scaling console discovers scalable resources in an application (by CloudFormation stack or tags) and lets you create scaling plans that apply predictive and dynamic scaling to EC2 Auto Scaling groups, ECS services, DynamoDB tables and Aurora replicas together, using a strategy such as optimise for availability, balance, or optimise for cost. For new configurations AWS recommends configuring policies directly on each service, including predictive scaling on Auto Scaling groups, but scaling plans remain available.
Troubleshooting Application Auto Scaling
When a resource does not scale as expected, the first step is to read its scaling activities with aws application-autoscaling describe-scaling-activities, which show each attempted change, its cause and any error message. Several causes recur. The capacity may already be at the minimum or maximum registered on the scalable target, which caps every policy. Scaling may be suspended, for example after a scheduled action or a manual call to register-scalable-target with suspended state. The service-linked role that Application Auto Scaling uses may be missing permissions, or the underlying service may reject the change, for example because an account quota is reached.
Target tracking policies create and manage their own CloudWatch alarms. These alarms must not be edited or deleted, because the policy depends on them; changes are made by updating the policy instead. Scale-in is also deliberately slower than scale-out, and some resources take time to apply a change, so a DynamoDB table or an Aurora cluster may lag behind a sudden burst. Predictable bursts are better handled with scheduled scaling ahead of the event.
Scaling an ECS service
An ECS service behind an ALB must scale between 3 and 30 tasks. The operator registers a scalable target for ecs:service:DesiredCount and adds a target tracking policy on ALBRequestCountPerTarget at 500. Because the cluster runs on EC2, the capacity provider's managed scaling adds container instances when tasks cannot be placed, so the two layers scale together without separate alarms.
aws application-autoscaling register-scalable-target --service-namespace ecs \
--resource-id service/prod-cluster/checkout --scalable-dimension ecs:service:DesiredCount \
--min-capacity 3 --max-capacity 30
aws application-autoscaling put-scaling-policy --service-namespace ecs \
--resource-id service/prod-cluster/checkout --scalable-dimension ecs:service:DesiredCount \
--policy-name req-per-target --policy-type TargetTrackingScaling \
--target-tracking-scaling-policy-configuration '{"TargetValue":500,
"PredefinedMetricSpecification":{"PredefinedMetricType":"ALBRequestCountPerTarget",
"ResourceLabel":"app/prod-alb/1234/targetgroup/checkout/5678"}}'Name three resources that Application Auto Scaling can scale.
Show answer
For example ECS services, DynamoDB capacity, Aurora replicas, Lambda provisioned concurrency and ElastiCache.
Exam Tips
Remember for the exam
- Application Auto Scaling scales ECS, DynamoDB, Aurora replicas, Lambda provisioned concurrency, ElastiCache and more.
- Register a scalable target, then attach target tracking, step or scheduled policies.
- ECS on EC2 needs capacity provider managed scaling for the instances as well as service scaling for tasks.