aws-cdk-lib.aws_applicationautoscaling.StepScalingAction

class StepScalingAction (construct)

LanguageType name
.NETAmazon.CDK.AWS.ApplicationAutoScaling.StepScalingAction
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsapplicationautoscaling#StepScalingAction
Javasoftware.amazon.awscdk.services.applicationautoscaling.StepScalingAction
Pythonaws_cdk.aws_applicationautoscaling.StepScalingAction
TypeScript (source)aws-cdk-lib » aws_applicationautoscaling » StepScalingAction

Implements IConstruct, IDependable

Define a step scaling action.

This kind of scaling policy adjusts the target capacity in configurable steps. The size of the step is configurable based on the metric's distance to its alarm threshold.

This Action must be used as the target of a CloudWatch alarm to take effect.

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';

declare const scalableTarget: appscaling.ScalableTarget;
const stepScalingAction = new appscaling.StepScalingAction(this, 'MyStepScalingAction', {
  scalingTarget: scalableTarget,

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

Initializer

new StepScalingAction(scope: Construct, id: string, props: StepScalingActionProps)

Parameters

  • scope Construct
  • id string
  • props StepScalingActionProps

Construct Props

NameTypeDescription
scalingTargetIScalableTargetThe scalable target.
adjustmentType?AdjustmentTypeHow the adjustment numbers are interpreted.
cooldown?DurationGrace period after scaling activity.
metricAggregationType?MetricAggregationTypeThe aggregation type for the CloudWatch metrics.
minAdjustmentMagnitude?numberMinimum absolute number to adjust capacity with as result of percentage scaling.
policyName?stringA name for the scaling policy.

scalingTarget

Type: IScalableTarget

The scalable target.


adjustmentType?

Type: AdjustmentType (optional, default: ChangeInCapacity)

How the adjustment numbers are interpreted.


cooldown?

Type: Duration (optional, default: No cooldown period)

Grace period after scaling activity.

For scale out policies, multiple scale outs during the cooldown period are squashed so that only the biggest scale out happens.

For scale in policies, subsequent scale ins during the cooldown period are ignored.

See also: https://docs.aws.amazon.com/autoscaling/application/APIReference/API_StepScalingPolicyConfiguration.html


metricAggregationType?

Type: MetricAggregationType (optional, default: Average)

The aggregation type for the CloudWatch metrics.


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.


policyName?

Type: string (optional, default: Automatically generated name)

A name for the scaling policy.

Properties

NameTypeDescription
nodeNodeThe tree node.
scalingPolicyArnstringARN of the scaling policy.

node

Type: Node

The tree node.


scalingPolicyArn

Type: string

ARN of the scaling policy.

Methods

NameDescription
addAdjustment(adjustment)Add an adjusment interval to the ScalingAction.
toString()Returns a string representation of this construct.

addAdjustment(adjustment)

public addAdjustment(adjustment: AdjustmentTier): void

Parameters

  • adjustment AdjustmentTier

Add an adjusment interval to the ScalingAction.


toString()

public toString(): string

Returns

  • string

Returns a string representation of this construct.