Skip to content
v2.274.0

BasicStepScalingPolicyProps Struct ​

Example ​

ts
declare const capacity: ScalableAttribute;
declare const cpuUtilization: cloudwatch.Metric;

capacity.scaleOnMetric('ScaleToCPU', {
  metric: cpuUtilization,
  scalingSteps: [
    { upper: 10, change: -1 },
    { lower: 50, change: +1 },
    { lower: 70, change: +3 },
  ],

  // Change this to AdjustmentType.PercentChangeInCapacity to interpret the
  // 'change' numbers before as percentages instead of capacity counts.
  adjustmentType: appscaling.AdjustmentType.CHANGE_IN_CAPACITY,
});

Properties ​

adjustmentTypeoptionalAdjustmentTypeadjustment_typeoptionalAdjustmentTypeadjustmentTypeoptionalAdjustmentTypeAdjustmentTypeoptionalAdjustmentTypeAdjustmentTypeoptionalAdjustmentType= ChangeInCapacity#
How the adjustment numbers inside 'intervals' are interpreted.
cooldownoptionalDurationcooldownoptionalDurationcooldownoptionalDurationCooldownoptionalDurationCooldownoptionalDuration#
Grace period after scaling activity.

Default: No cooldown period

Subsequent scale outs during the cooldown period are squashed so that only the biggest scale out happens.

Subsequent scale ins during the cooldown period are ignored.

datapointsToAlarmoptionalnumberdatapoints_to_alarmoptionalint | floatdatapointsToAlarmoptionalNumberDatapointsToAlarmoptionaldoubleDatapointsToAlarmoptional*float64#
The number of data points out of the evaluation periods that must be breaching to trigger a scaling action.

Default: Same as evaluationPeriods

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.

evaluationPeriodsoptionalnumberevaluation_periodsoptionalint | floatevaluationPeriodsoptionalNumberEvaluationPeriodsoptionaldoubleEvaluationPeriodsoptional*float64= 1#
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.

metricIMetricmetricIMetricmetricIMetricMetricIMetricMetricIMetricrequired#
Metric to scale on.
metricAggregationTypeoptionalMetricAggregationTypemetric_aggregation_typeoptionalMetricAggregationTypemetricAggregationTypeoptionalMetricAggregationTypeMetricAggregationTypeoptionalMetricAggregationTypeMetricAggregationTypeoptionalMetricAggregationType#
Aggregation to apply to all data points over the evaluation periods.

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

Only has meaning if evaluationPeriods != 1.

minAdjustmentMagnitudeoptionalnumbermin_adjustment_magnitudeoptionalint | floatminAdjustmentMagnitudeoptionalNumberMinAdjustmentMagnitudeoptionaldoubleMinAdjustmentMagnitudeoptional*float64#
Minimum absolute number to adjust capacity with as result of percentage scaling.

Default: No minimum scaling effect

Only when using AdjustmentType = PercentChangeInCapacity, this number controls the minimum absolute effect size.

scalingStepsScalingInterval[]scaling_stepstyping.List[ScalingInterval]scalingStepsList<ScalingInterval>ScalingStepsScalingInterval[]ScalingSteps*[]ScalingIntervalrequired#
The intervals for scaling.

Maps a range of metric values to a particular scaling behavior.

Must be between 2 and 40 steps.