AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

StepScalingPolicy

Define a acaling strategy which scales depending on absolute values of some metric. You can specify the scaling behavior for various values of the metric. Implemented using one or more CloudWatch alarms and Step Scaling Policies.

Import

import { StepScalingPolicy } from 'aws-cdk-lib/aws-autoscaling';

Or use the module namespace:

import * as autoscaling from 'aws-cdk-lib/aws-autoscaling';
// autoscaling.StepScalingPolicy

Properties

Configuration passed to the constructor as StepScalingPolicyProps.

autoScalingGroupRequired
IAutoScalingGroupRef

The auto scaling group.

9 properties inherited from BasicStepScalingPolicyProps
metricRequiredinherited from BasicStepScalingPolicyProps
IMetric

Metric to scale on.

scalingStepsRequiredinherited from BasicStepScalingPolicyProps
ScalingInterval[]

The intervals for scaling. Maps a range of metric values to a particular scaling behavior. Must be between 2 and 40 steps.

adjustmentTypeOptionalinherited from BasicStepScalingPolicyProps
AdjustmentType

How the adjustment numbers inside 'intervals' are interpreted.

Default: ChangeInCapacity

cooldownOptionalinherited from BasicStepScalingPolicyProps
Duration

Grace period after scaling activity.

Default: Default cooldown period on your AutoScalingGroup

datapointsToAlarmOptionalinherited from BasicStepScalingPolicyProps
number

The number of data points out of the evaluation periods that must be breaching to trigger a scaling action. Creates an "M out of N" alarm, where this property is the M and the value set for `evaluationPeriods` is the N value. Only has meaning if `evaluationPeriods != 1`. Must be less than or equal to `evaluationPeriods`.

Default: - Same as `evaluationPeriods`

estimatedInstanceWarmupOptionalinherited from BasicStepScalingPolicyProps
Duration

Estimated time until a newly launched instance can send metrics to CloudWatch.

Default: Same as the cooldown

evaluationPeriodsOptionalinherited from BasicStepScalingPolicyProps
number

How many evaluation periods of the metric to wait before triggering a scaling action. Raising this value can be used to smooth out the metric, at the expense of slower response times. If `datapointsToAlarm` is not set, then all data points in the evaluation period must meet the criteria to trigger a scaling action.

Default: 1

metricAggregationTypeOptionalinherited from BasicStepScalingPolicyProps
MetricAggregationType

Aggregation to apply to all data points over the evaluation periods. Only has meaning if `evaluationPeriods != 1`.

Default: - The statistic from the metric if applicable (MIN, MAX, AVERAGE), otherwise AVERAGE.

minAdjustmentMagnitudeOptionalinherited from BasicStepScalingPolicyProps
number

Minimum absolute number to adjust capacity with as result of percentage scaling. Only when using AdjustmentType = PercentChangeInCapacity, this number controls the minimum absolute effect size.

Default: No minimum scaling effect

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter