Skip to content

Commit

Permalink
feat(autoscaling): step scaling policy supports estimatedInstanceWarm…
Browse files Browse the repository at this point in the history
…up property (aws#20936)

Fix aws#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*
  • Loading branch information
BDeus authored and daschaa committed Jul 9, 2022
1 parent 4bd5bce commit eb5fc48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-autoscaling/lib/step-scaling-policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export class StepScalingPolicy extends Construct {
this.lowerAction = new StepScalingAction(this, 'LowerPolicy', {
adjustmentType: props.adjustmentType,
cooldown: props.cooldown,
estimatedInstanceWarmup: props.estimatedInstanceWarmup,
metricAggregationType: props.metricAggregationType ?? aggregationTypeFromMetric(props.metric),
minAdjustmentMagnitude: props.minAdjustmentMagnitude,
autoScalingGroup: props.autoScalingGroup,
Expand Down Expand Up @@ -138,6 +139,7 @@ export class StepScalingPolicy extends Construct {
this.upperAction = new StepScalingAction(this, 'UpperPolicy', {
adjustmentType: props.adjustmentType,
cooldown: props.cooldown,
estimatedInstanceWarmup: props.estimatedInstanceWarmup,
metricAggregationType: props.metricAggregationType ?? aggregationTypeFromMetric(props.metric),
minAdjustmentMagnitude: props.minAdjustmentMagnitude,
autoScalingGroup: props.autoScalingGroup,
Expand Down
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-autoscaling/test/scaling.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ describe('scaling', () => {
namespace: 'Henk',
dimensionsMap: { Mustache: 'Bushy' },
}),
estimatedInstanceWarmup: cdk.Duration.seconds(150),
// Adjust the number of legs to be closer to 2
scalingSteps: [
{ lower: 0, upper: 2, change: +1 },
Expand Down Expand Up @@ -241,6 +242,7 @@ describe('scaling', () => {
Template.fromStack(stack).hasResourceProperties('AWS::AutoScaling::ScalingPolicy', {
MetricAggregationType: 'Average',
PolicyType: 'StepScaling',
EstimatedInstanceWarmup: 150,
StepAdjustments: [
{
MetricIntervalUpperBound: 0,
Expand Down

0 comments on commit eb5fc48

Please sign in to comment.