-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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-autoscaling/aws-applicationautoscaling): StepScalingPolicy supports at most 40 steps #26215
Comments
Yes, Agree CDK should throw when the number of steps exceeds 40, rather than a build time failure. |
…ver allowable maximum (#26490) `StepScalingPolicy` did not have a validation that the number of intervals in `scalingSteps` was in the allowable range. The [Autoscaling documentation](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-quotas.html) states 20 is the maximum step changes in a policy, and since autoscaling creates 2 policies (an [UpperPolicy](https://github.com/aws/aws-cdk/blob/bc029fe5ac69a8b7fd2dfdbcd8834e9a2cf8e000/packages/aws-cdk-lib/aws-autoscaling/lib/step-scaling-policy.ts#L136-L166) and a [LowerPolicy](https://github.com/aws/aws-cdk/blob/bc029fe5ac69a8b7fd2dfdbcd8834e9a2cf8e000/packages/aws-cdk-lib/aws-autoscaling/lib/step-scaling-policy.ts#L105-L134)), our cap is 40. There is an identical change in Application Autoscaling. Closes #26215. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Thanks @scanlonp |
…ver allowable maximum (aws#26490) `StepScalingPolicy` did not have a validation that the number of intervals in `scalingSteps` was in the allowable range. The [Autoscaling documentation](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-quotas.html) states 20 is the maximum step changes in a policy, and since autoscaling creates 2 policies (an [UpperPolicy](https://github.com/aws/aws-cdk/blob/bc029fe5ac69a8b7fd2dfdbcd8834e9a2cf8e000/packages/aws-cdk-lib/aws-autoscaling/lib/step-scaling-policy.ts#L136-L166) and a [LowerPolicy](https://github.com/aws/aws-cdk/blob/bc029fe5ac69a8b7fd2dfdbcd8834e9a2cf8e000/packages/aws-cdk-lib/aws-autoscaling/lib/step-scaling-policy.ts#L105-L134)), our cap is 40. There is an identical change in Application Autoscaling. Closes aws#26215. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@scanlonp @SamStephens Is this the correct validation? I created a service with 22 scaling steps, which did not breach this validation. However upon deploy, I get a 400 ValidationException:
|
@jedkass so this fails to deploy but not caught at synth time? I will look into it; if you have a simple reproduction stack, that would be helpful. |
Correct. I honestly don't have a suuuuper simple repro stack. But I'm essentially calling a private method like below where
In my case, |
@jedkass great, I will try to reproduce and edit the validation to cover this! Since its not breaking (correct?), it may take a little time to get around to, but thanks for putting this on my radar. |
@scanlonp I appreciate it! Yea not breaking since it's an AWS limitation anyway. Just agree with the premise of this ticket that it should be caught at build time, so wanted to offer my experience that...it doesn't seem fixed. FYI, if I change my for loop to generate 41 scaling steps, |
Describe the bug
If you create a StepScalingPolicy with more than 40 steps, the Cloudformation deployment fails with the message "There can be at most 20 step adjustments per scaling policy".
The reason the limit is 40 and not 20 is because StepScalingPolicy creates two policies, an UpperPolicy and a LowerPolicy, each containing half the steps.
Expected Behavior
The deployment succeeds, with the steps split across the required number of policies.
If I've misunderstood the code, and there's a reason to specifically have two policies, I'd expect a build time failure from CDK when the number of steps exceeds 40, rather than a build time failure.
Current Behavior
Cloudformation deployment fails with the message "There can be at most 20 step adjustments per scaling policy".
Reproduction Steps
Starting with a Fargate Service and an SQS queue (I'm trying to reproduce the tracking policy https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-target-tracking-metric-math.html describes without using metric math).
Possible Solution
Allow for more than two scaling policies to be created (this may not make sense, my understanding of these policies is not great).
Additional Information/Context
No response
CDK CLI Version
2.86.0 (build 1130fab)
Framework Version
2.81.0
Node.js Version
v16.18.1
OS
Ubuntu (Windows Subsystem for Linux)
Language
Python
Language Version
3.9.7
Other information
No response
The text was updated successfully, but these errors were encountered: