BasicStepScalingPolicyProps Struct
Example
declare const autoScalingGroup: autoscaling.AutoScalingGroup;
const workerUtilizationMetric = new cloudwatch.Metric({
namespace: 'MyService',
metricName: 'WorkerUtilization'
});
autoScalingGroup.scaleOnMetric('ScaleToCPU', {
metric: workerUtilizationMetric,
scalingSteps: [
{ upper: 10, change: -1 },
{ lower: 50, change: +1 },
{ lower: 70, change: +3 },
],
evaluationPeriods: 10,
datapointsToAlarm: 5,
// Change this to AdjustmentType.PERCENT_CHANGE_IN_CAPACITY to interpret the
// 'change' numbers before as percentages instead of capacity counts.
adjustmentType: autoscaling.AdjustmentType.CHANGE_IN_CAPACITY,
});
Properties
adjustmentTypeoptionalAdjustmentTypeadjustment_typeoptionalAdjustmentTypeadjustmentTypeoptionalAdjustmentTypeAdjustmentTypeoptionalAdjustmentTypeAdjustmentTypeoptionalAdjustmentType= ChangeInCapacity#cooldownoptionalDurationcooldownoptionalDurationcooldownoptionalDurationCooldownoptionalDurationCooldownoptionalDuration#Default: Default cooldown period on your AutoScalingGroup
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. Must be less than or equal to evaluationPeriods.
estimatedInstanceWarmupoptionalDurationestimated_instance_warmupoptionalDurationestimatedInstanceWarmupoptionalDurationEstimatedInstanceWarmupoptionalDurationEstimatedInstanceWarmupoptionalDuration#Default: Same as the cooldown
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.