(aws-ecs): autoScaleTaskCount and scaleOnCpuUtilization don't add scaling policies to ECS service
See original GitHub issueI’m trying to set up target scaling for an ECS service following the documentation, but it doesn’t seem to be doing anything.
Reproduction Steps
service.autoScaleTaskCount(
EnableScalingProps.builder()
.minCapacity(app.minInstanceCount)
.maxCapacity(app.maxInstanceCount)
.build()
).scaleOnCpuUtilization(
"cpuScaling",
CpuUtilizationScalingProps.builder()
.scaleInCooldown(app.scaleInCooldown)
.scaleOutCooldown(app.scaleOutCooldown)
.targetUtilizationPercent(app.targetCpuUtilizationPercent)
.build()
)
What did you expect to happen?
I expect to see something like this:
What actually happened?
Instead I see:
Environment
- CDK CLI Version : 1.99.0
- Framework Version: 1.99.0
- Node.js Version: v14.15.0
- OS : MacOs BigSur
- Language (Version): Kotlin (Java 11)
Other
What this looks like in CloudFormation:
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6
Top Results From Across the Web
Step 5: Configuring your service to use Service Auto Scaling
Amazon ECS Service Auto Scaling supports the following types of scaling policies: Target tracking scaling policies (Recommended)—Increase or decrease the number ...
Read more >Configure Amazon ECS Service Auto Scaling on Fargate
When your CloudWatch alarms trigger an Auto Scaling policy, Application Auto Scaling decides the new desired count based on the configured ...
Read more >Service auto scaling - Amazon Elastic Container Service
Amazon ECS Service Auto Scaling supports the following types of automatic scaling: Target tracking scaling policies— Increase or decrease the number of tasks ......
Read more >Troubleshoot service auto scaling issues in Amazon ECS
Your ECS Cluster doesn't have enough resources or capacity to run new tasks. Resolution. Troubleshooting CloudWatch alarms and scaling policies.
Read more >ECS Service Auto-Scaling with the CDK - Idan Lupinsky
This is an AWS service that manages scaling of other services such as DynamoDB, RDS, and ECS. Each of these managed services consists...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Probably related: For scheduledTasks (
scaleOnSchedule
) the scaling is working, but they do not show under Scheduled Tasks in the UI.cdk v. 1.129.0
This is because the ClusterName now contains ARN, but Cloudwatch alarm (for autoscaling) doesn’t like it.
If you change to using cluster name, it should be fine - however this requires an additional step to change the cluster name. CDK should handle it properly