class StepScalingAction (construct)
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.AutoScaling.StepScalingAction |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsautoscaling#StepScalingAction |
![]() | software.amazon.awscdk.services.autoscaling.StepScalingAction |
![]() | aws_cdk.aws_autoscaling.StepScalingAction |
![]() | aws-cdk-lib » aws_autoscaling » 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_autoscaling as autoscaling } from 'aws-cdk-lib';
declare const autoScalingGroup: autoscaling.AutoScalingGroup;
const stepScalingAction = new autoscaling.StepScalingAction(this, 'MyStepScalingAction', {
autoScalingGroup: autoScalingGroup,
// the properties below are optional
adjustmentType: autoscaling.AdjustmentType.CHANGE_IN_CAPACITY,
cooldown: cdk.Duration.minutes(30),
estimatedInstanceWarmup: cdk.Duration.minutes(30),
metricAggregationType: autoscaling.MetricAggregationType.AVERAGE,
minAdjustmentMagnitude: 123,
});
Initializer
new StepScalingAction(scope: Construct, id: string, props: StepScalingActionProps)
Parameters
- scope
Construct
- id
string
- props
Step
Scaling Action Props
Construct Props
Name | Type | Description |
---|---|---|
auto | IAuto | The auto scaling group. |
adjustment | Adjustment | How the adjustment numbers are interpreted. |
cooldown? | Duration | Period after a scaling completes before another scaling activity can start. |
estimated | Duration | Estimated time until a newly launched instance can send metrics to CloudWatch. |
metric | Metric | The aggregation type for the CloudWatch metrics. |
min | number | Minimum absolute number to adjust capacity with as result of percentage scaling. |
autoScalingGroup
Type:
IAuto
The auto scaling group.
adjustmentType?
Type:
Adjustment
(optional, default: ChangeInCapacity)
How the adjustment numbers are interpreted.
cooldown?
⚠️ Deprecated: cooldown is not valid with step scaling action
Type:
Duration
(optional, default: The default cooldown configured on the AutoScalingGroup)
Period after a scaling completes before another scaling activity can start.
estimatedInstanceWarmup?
Type:
Duration
(optional, default: Same as the cooldown)
Estimated time until a newly launched instance can send metrics to CloudWatch.
metricAggregationType?
Type:
Metric
(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.
Properties
Name | Type | Description |
---|---|---|
node | Node | The tree node. |
scaling | string | ARN of the scaling policy. |
node
Type:
Node
The tree node.
scalingPolicyArn
Type:
string
ARN of the scaling policy.
Methods
Name | Description |
---|---|
add | Add an adjusment interval to the ScalingAction. |
to | Returns a string representation of this construct. |
addAdjustment(adjustment)
public addAdjustment(adjustment: AdjustmentTier): void
Parameters
- adjustment
Adjustment
Tier
Add an adjusment interval to the ScalingAction.
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.