aws / aws/aws-cdk

(aws-ecs): autoScaleTaskCount and scaleOnCpuUtilization don't add scaling policies to ECS service

Open
#14,297 12 comments 4 reactions 1 assignee Claimed by @GavinZZ View on GitHub
@aws-cdk/aws-ecs bug p1
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
1d 19h
Merged PRs (30d)
71

Description

I'm trying to set up target scaling for an ECS service following the [documentation](https://docs.aws.amazon.com/cdk/api/latest/docs/aws-ecs-readme.html#task-auto-scaling), 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:
![Screenshot 2021-04-21 at 09 47 36](https://user-images.githubusercontent.com/40452559/115522761-aefefe00-a28c-11eb-8f75-4b39508b9b57.png)

### What actually happened?
Instead I see:
![Screenshot 2021-04-21 at 09 42 14](https://user-images.githubusercontent.com/40452559/115522831-bfaf7400-a28c-11eb-8438-67c4e480e6f0.png)

### 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:
![Screenshot 2021-04-21 at 10 33 00](https://user-images.githubusercontent.com/40452559/115523213-2339a180-a28d-11eb-8b17-74d77f26470c.png)

---

This is :bug: Bug Report

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.