-
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): step scaling without adjustment type fails #29158
Conversation
@@ -147,7 +147,7 @@ export class StepScalingPolicy extends Construct { | |||
const threshold = intervals[alarms.lowerAlarmIntervalIndex].upper; | |||
|
|||
this.lowerAction = new StepScalingAction(this, 'LowerPolicy', { | |||
adjustmentType: props.adjustmentType, | |||
adjustmentType, |
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 property is defined here.
I could change an integ test and snapshots |
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.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
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 good to me 👍
packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.asg-step-scaling.ts
Outdated
Show resolved
Hide resolved
…/test/integ.asg-step-scaling.ts Co-authored-by: Luca Pizzini <[email protected]>
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.
LGTM, thanks for contributing
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). |
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). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Reason for this change
Step Scaling without
adjustmentType
fails with CFn errorYou must specify an AdjustmentType for policy type: StepScaling
.Description of changes
According to the CDK code,
CHANGE_IN_CAPACITY
will be used ifadjustmentType
is not specified in the prop. But the variable is not passed intoStepScalingAction
construct (insteadprops.adjustmentType
is passed as is).The documentation also says that the default value is
CHANGE_IN_CAPACITY
.So we should use
adjustmentType
instead ofprops.adjustmentType
.The fact that the error occurs if
props.adjustmentType
is not specified means that the user's successful existing stack always specifiesprops.adjustmentType
. In other words, no change to the existing resource will occur due to this change, so there is no need for a feature flag.Description of how you validated changes
Unit tests without integ tests, because this PR could cover this bug by unit tests.Both unit and integ tests.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license