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 { StepScalingPolicy } from 'aws-cdk-lib/aws-autoscaling';Or use the module namespace:
import * as autoscaling from 'aws-cdk-lib/aws-autoscaling';
// autoscaling.StepScalingPolicyConfiguration passed to the constructor as StepScalingPolicyProps.
autoScalingGroupRequiredIAutoScalingGroupRefThe auto scaling group.
BasicStepScalingPolicyPropsmetricRequiredinherited from BasicStepScalingPolicyPropsIMetricMetric to scale on.
scalingStepsRequiredinherited from BasicStepScalingPolicyPropsScalingInterval[]The intervals for scaling. Maps a range of metric values to a particular scaling behavior. Must be between 2 and 40 steps.
adjustmentTypeOptionalinherited from BasicStepScalingPolicyPropsAdjustmentTypeHow the adjustment numbers inside 'intervals' are interpreted.
Default: ChangeInCapacity
cooldownOptionalinherited from BasicStepScalingPolicyPropsDurationGrace period after scaling activity.
Default: Default cooldown period on your AutoScalingGroup
datapointsToAlarmOptionalinherited from BasicStepScalingPolicyPropsnumberThe 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 BasicStepScalingPolicyPropsDurationEstimated time until a newly launched instance can send metrics to CloudWatch.
Default: Same as the cooldown
evaluationPeriodsOptionalinherited from BasicStepScalingPolicyPropsnumberHow 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 BasicStepScalingPolicyPropsMetricAggregationTypeAggregation 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 BasicStepScalingPolicyPropsnumberMinimum 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
Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.
Subscribe to Newsletteraws-autoscaling