StepScalingPolicyProps Struct
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_applicationautoscaling as appscaling } from 'aws-cdk-lib';
import { aws_cloudwatch as cloudwatch } from 'aws-cdk-lib';
import { aws_applicationautoscaling as interfaces_applicationautoscaling } from 'aws-cdk-lib/interfaces';
declare const metric: cloudwatch.Metric;
declare const scalableTargetRef: interfaces_applicationautoscaling.IScalableTargetRef;
const stepScalingPolicyProps: appscaling.StepScalingPolicyProps = {
metric: metric,
scalingSteps: [{
change: 123,
// the properties below are optional
lower: 123,
upper: 123,
}],
scalingTarget: scalableTargetRef,
// the properties below are optional
adjustmentType: appscaling.AdjustmentType.CHANGE_IN_CAPACITY,
cooldown: cdk.Duration.minutes(30),
datapointsToAlarm: 123,
evaluationPeriods: 123,
metricAggregationType: appscaling.MetricAggregationType.AVERAGE,
minAdjustmentMagnitude: 123,
};
Properties
adjustmentTypeoptionalAdjustmentTypeadjustment_typeoptionalAdjustmentTypeadjustmentTypeoptionalAdjustmentTypeAdjustmentTypeoptionalAdjustmentTypeAdjustmentTypeoptionalAdjustmentType= ChangeInCapacity#cooldownoptionalDurationcooldownoptionalDurationcooldownoptionalDurationCooldownoptionalDurationCooldownoptionalDuration#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#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#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.
metricAggregationTypeoptionalMetricAggregationTypemetric_aggregation_typeoptionalMetricAggregationTypemetricAggregationTypeoptionalMetricAggregationTypeMetricAggregationTypeoptionalMetricAggregationTypeMetricAggregationTypeoptionalMetricAggregationType#Default: The statistic from the metric if applicable (MIN, MAX, AVERAGE), otherwise AVERAGE.
Only has meaning if evaluationPeriods != 1.
minAdjustmentMagnitudeoptionalnumbermin_adjustment_magnitudeoptionalint | floatminAdjustmentMagnitudeoptionalNumberMinAdjustmentMagnitudeoptionaldoubleMinAdjustmentMagnitudeoptional*float64#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#Maps a range of metric values to a particular scaling behavior.
Must be between 2 and 40 steps.
scalingTargetIScalableTargetRefscaling_targetIScalableTargetRefscalingTargetIScalableTargetRefScalingTargetIScalableTargetRefScalingTargetIScalableTargetRefrequired#