aws-cdk-lib.aws_autoscaling.StepScalingPolicyProps

interface StepScalingPolicyProps

LanguageType name
.NETAmazon.CDK.AWS.AutoScaling.StepScalingPolicyProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsautoscaling#StepScalingPolicyProps
Javasoftware.amazon.awscdk.services.autoscaling.StepScalingPolicyProps
Pythonaws_cdk.aws_autoscaling.StepScalingPolicyProps
TypeScript (source)aws-cdk-lib » aws_autoscaling » StepScalingPolicyProps

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_autoscaling as autoscaling } from 'aws-cdk-lib';
import { aws_cloudwatch as cloudwatch } from 'aws-cdk-lib';

declare const autoScalingGroup: autoscaling.AutoScalingGroup;
declare const metric: cloudwatch.Metric;
const stepScalingPolicyProps: autoscaling.StepScalingPolicyProps = {
  autoScalingGroup: autoScalingGroup,
  metric: metric,
  scalingSteps: [{
    change: 123,

    // the properties below are optional
    lower: 123,
    upper: 123,
  }],

  // the properties below are optional
  adjustmentType: autoscaling.AdjustmentType.CHANGE_IN_CAPACITY,
  cooldown: cdk.Duration.minutes(30),
  estimatedInstanceWarmup: cdk.Duration.minutes(30),
  evaluationPeriods: 123,
  metricAggregationType: autoscaling.MetricAggregationType.AVERAGE,
  minAdjustmentMagnitude: 123,
};

Properties

NameTypeDescription
autoScalingGroupIAutoScalingGroupThe auto scaling group.
metricIMetricMetric to scale on.
scalingStepsScalingInterval[]The intervals for scaling.
adjustmentType?AdjustmentTypeHow the adjustment numbers inside 'intervals' are interpreted.
cooldown?DurationGrace period after scaling activity.
estimatedInstanceWarmup?DurationEstimated time until a newly launched instance can send metrics to CloudWatch.
evaluationPeriods?numberHow many evaluation periods of the metric to wait before triggering a scaling action.
metricAggregationType?MetricAggregationTypeAggregation to apply to all data points over the evaluation periods.
minAdjustmentMagnitude?numberMinimum absolute number to adjust capacity with as result of percentage scaling.

autoScalingGroup

Type: IAutoScalingGroup

The auto scaling group.


metric

Type: IMetric

Metric to scale on.


scalingSteps

Type: ScalingInterval[]

The intervals for scaling.

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


adjustmentType?

Type: AdjustmentType (optional, default: ChangeInCapacity)

How the adjustment numbers inside 'intervals' are interpreted.


cooldown?

Type: Duration (optional, default: Default cooldown period on your AutoScalingGroup)

Grace period after scaling activity.


estimatedInstanceWarmup?

Type: Duration (optional, default: Same as the cooldown)

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


evaluationPeriods?

Type: number (optional, default: 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.


metricAggregationType?

Type: MetricAggregationType (optional, default: The statistic from the metric if applicable (MIN, MAX, AVERAGE), otherwise AVERAGE.)

Aggregation to apply to all data points over the evaluation periods.

Only has meaning if evaluationPeriods != 1.


minAdjustmentMagnitude?

Type: number (optional, default: No minimum scaling effect)

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.