Skip to content

Commit e4c7b97

Browse files
authored
feat(autoscaling): step scaling policy supports estimatedInstanceWarmup property (#20936)
Fix #10514 ---- ### All Submissions: * [ x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 42d1d7c commit e4c7b97

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

packages/@aws-cdk/aws-autoscaling/lib/step-scaling-policy.ts

+2
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ export class StepScalingPolicy extends Construct {
108108
this.lowerAction = new StepScalingAction(this, 'LowerPolicy', {
109109
adjustmentType: props.adjustmentType,
110110
cooldown: props.cooldown,
111+
estimatedInstanceWarmup: props.estimatedInstanceWarmup,
111112
metricAggregationType: props.metricAggregationType ?? aggregationTypeFromMetric(props.metric),
112113
minAdjustmentMagnitude: props.minAdjustmentMagnitude,
113114
autoScalingGroup: props.autoScalingGroup,
@@ -138,6 +139,7 @@ export class StepScalingPolicy extends Construct {
138139
this.upperAction = new StepScalingAction(this, 'UpperPolicy', {
139140
adjustmentType: props.adjustmentType,
140141
cooldown: props.cooldown,
142+
estimatedInstanceWarmup: props.estimatedInstanceWarmup,
141143
metricAggregationType: props.metricAggregationType ?? aggregationTypeFromMetric(props.metric),
142144
minAdjustmentMagnitude: props.minAdjustmentMagnitude,
143145
autoScalingGroup: props.autoScalingGroup,

packages/@aws-cdk/aws-autoscaling/test/scaling.test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ describe('scaling', () => {
205205
namespace: 'Henk',
206206
dimensionsMap: { Mustache: 'Bushy' },
207207
}),
208+
estimatedInstanceWarmup: cdk.Duration.seconds(150),
208209
// Adjust the number of legs to be closer to 2
209210
scalingSteps: [
210211
{ lower: 0, upper: 2, change: +1 },
@@ -241,6 +242,7 @@ describe('scaling', () => {
241242
Template.fromStack(stack).hasResourceProperties('AWS::AutoScaling::ScalingPolicy', {
242243
MetricAggregationType: 'Average',
243244
PolicyType: 'StepScaling',
245+
EstimatedInstanceWarmup: 150,
244246
StepAdjustments: [
245247
{
246248
MetricIntervalUpperBound: 0,

0 commit comments

Comments
 (0)