-
Notifications
You must be signed in to change notification settings - Fork 4.4k
@aws-cdk/aws-ecs-patterns: minScalingCapacity cannot be set to 0 #15632
Copy link
Copy link
Closed
Labels
@aws-cdk/aws-ecs-patternsRelated to ecs-patterns libraryRelated to ecs-patterns librarybugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp2
Description
Reproduction Steps
It is impossible to set minScalingCapacity on a SQS-processing Fargate task to 0, because of this check:
aws-cdk/packages/@aws-cdk/aws-ecs-patterns/lib/base/queue-processing-service-base.ts
Line 315 in 2647cf3
| this.minCapacity = props.minScalingCapacity || this.desiredCount; |
The operator || treats 0 as a falsy value. Use ?? instead. A workaround seems to be to set desiredTaskCount deprecated prop to 0, since that's used in the falsy branch path.
What did you expect to happen?
minScalingCapacity set to 0 should deploy autoscaling with minimum tasks: 0.
What actually happened?
minScalingCapacity set to 0 deploys ECS autoscaling with minimum tasks: 1.
Environment
- CDK CLI Version : 1.114.0 (build 7e41b6b)
- Framework Version: 1.114.0
- Node.js Version: v14.17.1
- OS : Win 10
- Language (Version): TypeScript (3.9.10)
This is 🐛 Bug Report
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-ecs-patternsRelated to ecs-patterns libraryRelated to ecs-patterns librarybugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp2