Skip to content
v2.278.0

StepScalingActionProps Struct ​

Properties for a scaling policy.

Example ​

ts
// 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_applicationautoscaling as interfaces_applicationautoscaling } from 'aws-cdk-lib/interfaces';

declare const scalableTargetRef: interfaces_applicationautoscaling.IScalableTargetRef;
const stepScalingActionProps: appscaling.StepScalingActionProps = {
  scalingTarget: scalableTargetRef,

  // the properties below are optional
  adjustmentType: appscaling.AdjustmentType.CHANGE_IN_CAPACITY,
  cooldown: cdk.Duration.minutes(30),
  metricAggregationType: appscaling.MetricAggregationType.AVERAGE,
  minAdjustmentMagnitude: 123,
  policyName: 'policyName',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk
from aws_cdk import aws_applicationautoscaling as appscaling
from aws_cdk.interfaces import aws_applicationautoscaling as interfaces_applicationautoscaling

# scalable_target_ref: interfaces_applicationautoscaling.IScalableTargetRef

step_scaling_action_props = appscaling.StepScalingActionProps(
    scaling_target=scalable_target_ref,

    # the properties below are optional
    adjustment_type=appscaling.AdjustmentType.CHANGE_IN_CAPACITY,
    cooldown=cdk.Duration.minutes(30),
    metric_aggregation_type=appscaling.MetricAggregationType.AVERAGE,
    min_adjustment_magnitude=123,
    policy_name="policyName"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.applicationautoscaling.*;
import software.amazon.awscdk.interfaces.applicationautoscaling.*;

IScalableTargetRef scalableTargetRef;

StepScalingActionProps stepScalingActionProps = StepScalingActionProps.builder()
        .scalingTarget(scalableTargetRef)

        // the properties below are optional
        .adjustmentType(AdjustmentType.CHANGE_IN_CAPACITY)
        .cooldown(Duration.minutes(30))
        .metricAggregationType(MetricAggregationType.AVERAGE)
        .minAdjustmentMagnitude(123)
        .policyName("policyName")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.ApplicationAutoScaling;
using Amazon.CDK.Interfaces.ApplicationAutoScaling;

IScalableTargetRef scalableTargetRef;

var stepScalingActionProps = new StepScalingActionProps {
    ScalingTarget = scalableTargetRef,

    // the properties below are optional
    AdjustmentType = AdjustmentType.CHANGE_IN_CAPACITY,
    Cooldown = Duration.Minutes(30),
    MetricAggregationType = MetricAggregationType.AVERAGE,
    MinAdjustmentMagnitude = 123,
    PolicyName = "policyName"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var scalableTargetRef IScalableTargetRef

stepScalingActionProps := &StepScalingActionProps{
	ScalingTarget: scalableTargetRef,

	// the properties below are optional
	AdjustmentType: awscdk.Aws_applicationautoscaling.AdjustmentType_CHANGE_IN_CAPACITY,
	Cooldown: cdk.Duration_Minutes(jsii.Number(30)),
	MetricAggregationType: awscdk.*Aws_applicationautoscaling.MetricAggregationType_AVERAGE,
	MinAdjustmentMagnitude: jsii.Number(123),
	PolicyName: jsii.String("policyName"),
}

Properties ​

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

Default: No cooldown period

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.

metricAggregationTypeoptionalMetricAggregationTypemetric_aggregation_typeoptionalMetricAggregationTypemetricAggregationTypeoptionalMetricAggregationTypeMetricAggregationTypeoptionalMetricAggregationTypeMetricAggregationTypeoptionalMetricAggregationType = Average #
The aggregation type for the CloudWatch metrics.
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.

policyNameoptionalstringpolicy_nameoptionalstrpolicyNameoptionalStringPolicyNameoptionalstringPolicyNameoptional*string #
A name for the scaling policy.

Default: Automatically generated name

scalingTargetIScalableTargetRefscaling_targetIScalableTargetRefscalingTargetIScalableTargetRefScalingTargetIScalableTargetRefScalingTargetIScalableTargetRef required #
The scalable target.