PutScalingPolicy
In this article:
PutScalingPolicy#
Description#
Creates or updates a scaling policy for an Auto Scaling Group (ASG).
Request Parameters#
Required parameters#
AutoScalingGroupName — The name of the ASG.
Type: String
Required: Yes
PolicyName — The name of the policy.
Type: String
Required: Yes
Constraints: 1 to 255 ASCII characters
PolicyType — The type of the policy.
Type: String
Required: Yes
Valid values:
SimpleScaling
Optional parameters#
AdjustmentType — Specifies how the value of the ScalingAdjustment parameter is interpreted when the scaling policy is executed.
Type: String
Required: No
Valid values:
ChangeInCapacity
|ExactCapacity
|PercentChangeInCapacity
Default value:
ChangeInCapacity
Constraints: It can be set only for the SimpleScaling` policy
Cooldown — The time (in seconds) after which the execution of the policy will create a new activity.
Type: Integer
Required: No
Default value: The value of the DefaultCooldown parameter for the ASG specified in the AutoScalingGroupName parameter
Constraints: It can be set only for the SimpleScaling` policy
Enabled — Indicates whether the policy is enabled.
Type: Boolean
Required: No
Default value:
True
MinAdjustmentMagnitude — The minimum ASG capacity percentage, by which the capacity will be scaled.
Type: Integer
Constraints: It can be specified only for the
SimpleScaling
policy when AdjustmentType is equal toPercentChangeInCapacity
ScalingAdjustment — The amount by which the ASG is scaled when the scaling policy is executed.
Type: Integer
Required: No
Constraints: It can be set only for the SimpleScaling` policy
Examples#
c2-as PutScalingPolicy AutoScalingGroupName "asg_name" PolicyName "policy_name" PolicyType "SimpleScaling" Enabled True AdjustmentType ChangeInCapacity ScalingAdjustment 1
c2-as PutScalingPolicy AutoScalingGroupName "asg_name" PolicyName "policy_name" PolicyType "SimpleScaling" Enabled True Cooldown 300 AdjustmentType PercentChangeInCapacity ScalingAdjustment 1 MinAdjustmentMagnitude 5