-
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
fix(autoscaling): StepScalingPolicy intervals not checked for going over allowable maximum #26490
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
Clarification Request: this PR should not require an integration test because it does not change the API nor add any features. It moves an error that would have been thrown at deploy time to one that is thrown at synth time. Correct? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty solid, one minor comment
@@ -111,6 +113,10 @@ export class StepScalingPolicy extends Construct { | |||
throw new Error('You must supply at least 2 intervals for autoscaling'); | |||
} | |||
|
|||
if (props.scalingSteps.length > 40) { | |||
throw new Error('You must have less than 40 steps in StepScalingPolicyProps.scalingSteps'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should mention how many steps were requested
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
packages/aws-cdk-lib/aws-autoscaling/lib/step-scaling-policy.ts
Outdated
Show resolved
Hide resolved
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
…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*
StepScalingPolicy
did not have a validation that the number of intervals inscalingSteps
was in the allowable range. The Autoscaling documentation states 20 is the maximum step changes in a policy, and since autoscaling creates 2 policies (an UpperPolicy and a LowerPolicy), 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