-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(aws-ecs-patterns): QueueProcessingServiceBase does not respect a minScalingCapacity: 0
#14336
Labels
@aws-cdk/aws-ecs-patterns
Related to ecs-patterns library
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
p2
Comments
wittekm
added
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
labels
Apr 22, 2021
peterwoodworth
added
the
@aws-cdk/aws-ecs-patterns
Related to ecs-patterns library
label
Apr 23, 2021
As a workaround, it looks like I can piggyback on the |
SoManyHs
added
effort/small
Small work item – less than a day of effort
p2
and removed
needs-triage
This issue or PR still needs to be triaged.
labels
May 5, 2021
|
TikiTDO
pushed a commit
to TikiTDO/aws-cdk
that referenced
this issue
Feb 21, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
@aws-cdk/aws-ecs-patterns
Related to ecs-patterns library
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
p2
In the following code:
aws-cdk/packages/@aws-cdk/aws-ecs-patterns/lib/base/queue-processing-service-base.ts
Line 312 in 75c96d7
I am in a situation where:
this.node.setContext(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT, true);
(putting me in the else-else clause on line 312)new ecs_patterns.QueueProcessingFargateService
props.minScalingCapacity
of 0 - which appears to be a completely valid number when using the ECS UI - but that is being overridden by the|| 1
Reproduction Steps
Described reasonably well above. Create a
new ecs_patterns.QueueProcessingFargateService
withminScalingCapacity: 0
and inspect the generated Cfn template; it'll show a non-zero for MinCapacity. In my case:What did you expect to happen?
Create a Cfn AWS::ApplicationAutoScaling::ScalableTarget with MinCapacity: 0
What actually happened?
Created a Cfn AWS::ApplicationAutoScaling::ScalableTarget with MinCapacity: 1
Environment
Other
Suggested solution:
Consider using
= props.minScalingCapacity ?? 1
- this is the new Typescript Nullish Coalescing Operator, which slightly differs from||
in that it will accept values like 0 and false, instead of falling through to the backup.In general, you'd probably want to do a serious audit of all uses of
x = x || y
in cases where, say, 0 is a valid prop.This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: