Skip to content

PutScalingPolicyType

Source code in docs_src/capo_auto_scaling/types/put_scaling_policy_type.py
class PutScalingPolicyType(TypedDict, closed=True):
    auto_scaling_group_name: NotRequired[
        "capo_auto_scaling.types.xml_string_max_len255.XmlStringMaxLen255"
    ]
    """<p>The name of the Auto Scaling group.</p>"""
    policy_name: NotRequired[
        "capo_auto_scaling.types.xml_string_max_len255.XmlStringMaxLen255"
    ]
    """<p>The name of the policy.</p>"""
    policy_type: NotRequired[
        "capo_auto_scaling.types.xml_string_max_len64.XmlStringMaxLen64"
    ]
    """<p>One of the following policy types: </p> <ul> <li> <p> <code>TargetTrackingScaling</code> </p> </li> <li> <p> <code>StepScaling</code> </p> </li> <li> <p> <code>SimpleScaling</code> (default)</p> </li> <li> <p> <code>PredictiveScaling</code> </p> </li> </ul>"""
    adjustment_type: NotRequired[
        "capo_auto_scaling.types.xml_string_max_len255.XmlStringMaxLen255"
    ]
    """<p>Specifies how the scaling adjustment is interpreted (for example, an absolute number or a percentage). The valid values are <code>ChangeInCapacity</code>, <code>ExactCapacity</code>, and <code>PercentChangeInCapacity</code>.</p> <p>Required if the policy type is <code>StepScaling</code> or <code>SimpleScaling</code>. For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html#as-scaling-adjustment">Scaling adjustment types</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>"""
    min_adjustment_step: NotRequired[
        "capo_auto_scaling.types.min_adjustment_step.MinAdjustmentStep"
    ]
    """<p>Available for backward compatibility. Use <code>MinAdjustmentMagnitude</code> instead.</p>"""
    min_adjustment_magnitude: NotRequired[
        "capo_auto_scaling.types.min_adjustment_magnitude.MinAdjustmentMagnitude"
    ]
    """<p>The minimum value to scale by when the adjustment type is <code>PercentChangeInCapacity</code>. For example, suppose that you create a step scaling policy to scale out an Auto Scaling group by 25 percent and you specify a <code>MinAdjustmentMagnitude</code> of 2. If the group has 4 instances and the scaling policy is performed, 25 percent of 4 is 1. However, because you specified a <code>MinAdjustmentMagnitude</code> of 2, Amazon EC2 Auto Scaling scales out the group by 2 instances.</p> <p>Valid only if the policy type is <code>StepScaling</code> or <code>SimpleScaling</code>. For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html#as-scaling-adjustment">Scaling adjustment types</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <note> <p>Some Auto Scaling groups use instance weights. In this case, set the <code>MinAdjustmentMagnitude</code> to a value that is at least as large as your largest instance weight.</p> </note>"""
    scaling_adjustment: NotRequired[
        "capo_auto_scaling.types.policy_increment.PolicyIncrement"
    ]
    """<p>The amount by which to scale, based on the specified adjustment type. A positive value adds to the current capacity while a negative number removes from the current capacity. For exact capacity, you must specify a non-negative value.</p> <p>Required if the policy type is <code>SimpleScaling</code>. (Not used with any other policy type.) </p>"""
    cooldown: NotRequired["capo_auto_scaling.types.cooldown.Cooldown"]
    """<p>A cooldown period, in seconds, that applies to a specific simple scaling policy. When a cooldown period is specified here, it overrides the default cooldown.</p> <p>Valid only if the policy type is <code>SimpleScaling</code>. For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-scaling-cooldowns.html">Scaling cooldowns for Amazon EC2 Auto Scaling</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <p>Default: None</p>"""
    metric_aggregation_type: NotRequired[
        "capo_auto_scaling.types.xml_string_max_len32.XmlStringMaxLen32"
    ]
    """<p>The aggregation type for the CloudWatch metrics. The valid values are <code>Minimum</code>, <code>Maximum</code>, and <code>Average</code>. If the aggregation type is null, the value is treated as <code>Average</code>.</p> <p>Valid only if the policy type is <code>StepScaling</code>.</p>"""
    step_adjustments: NotRequired[
        "capo_auto_scaling.types.step_adjustments.StepAdjustments"
    ]
    """<p>A set of adjustments that enable you to scale based on the size of the alarm breach.</p> <p>Required if the policy type is <code>StepScaling</code>. (Not used with any other policy type.) </p>"""
    estimated_instance_warmup: NotRequired[
        "capo_auto_scaling.types.estimated_instance_warmup.EstimatedInstanceWarmup"
    ]
    """<p> <i>Not needed if the default instance warmup is defined for the group.</i> </p> <p>The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. This warm-up period applies to instances launched due to a specific target tracking or step scaling policy. When a warm-up period is specified here, it overrides the default instance warmup.</p> <p>Valid only if the policy type is <code>TargetTrackingScaling</code> or <code>StepScaling</code>.</p> <note> <p>The default is to use the value for the default instance warmup defined for the group. If default instance warmup is null, then <code>EstimatedInstanceWarmup</code> falls back to the value of default cooldown.</p> </note>"""
    target_tracking_configuration: NotRequired[
        "capo_auto_scaling.types.target_tracking_configuration.TargetTrackingConfiguration"
    ]
    """<p>A target tracking scaling policy. Provides support for predefined or custom metrics.</p> <p>The following predefined metrics are available:</p> <ul> <li> <p> <code>ASGAverageCPUUtilization</code> </p> </li> <li> <p> <code>ASGAverageNetworkIn</code> </p> </li> <li> <p> <code>ASGAverageNetworkOut</code> </p> </li> <li> <p> <code>ALBRequestCountPerTarget</code> </p> </li> </ul> <p>If you specify <code>ALBRequestCountPerTarget</code> for the metric, you must specify the <code>ResourceLabel</code> property with the <code>PredefinedMetricSpecification</code>.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_TargetTrackingConfiguration.html">TargetTrackingConfiguration</a> in the <i>Amazon EC2 Auto Scaling API Reference</i>.</p> <p>Required if the policy type is <code>TargetTrackingScaling</code>.</p>"""
    enabled: NotRequired[
        "capo_auto_scaling.types.scaling_policy_enabled.ScalingPolicyEnabled"
    ]
    """<p>Indicates whether the scaling policy is enabled or disabled. The default is enabled. For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-enable-disable-scaling-policy.html">Disable a scaling policy for an Auto Scaling group</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>"""
    predictive_scaling_configuration: NotRequired[
        "capo_auto_scaling.types.predictive_scaling_configuration.PredictiveScalingConfiguration"
    ]
    """<p>A predictive scaling policy. Provides support for predefined and custom metrics.</p> <p>Predefined metrics include CPU utilization, network in/out, and the Application Load Balancer request count.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_PredictiveScalingConfiguration.html">PredictiveScalingConfiguration</a> in the <i>Amazon EC2 Auto Scaling API Reference</i>.</p> <p>Required if the policy type is <code>PredictiveScaling</code>.</p>"""

adjustment_type instance-attribute

adjustment_type: NotRequired[XmlStringMaxLen255]

Specifies how the scaling adjustment is interpreted (for example, an absolute number or a percentage). The valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

Required if the policy type is StepScaling or SimpleScaling. For more information, see Scaling adjustment types in the Amazon EC2 Auto Scaling User Guide.

auto_scaling_group_name instance-attribute

auto_scaling_group_name: NotRequired[XmlStringMaxLen255]

The name of the Auto Scaling group.

cooldown instance-attribute

cooldown: NotRequired[Cooldown]

A cooldown period, in seconds, that applies to a specific simple scaling policy. When a cooldown period is specified here, it overrides the default cooldown.

Valid only if the policy type is SimpleScaling. For more information, see Scaling cooldowns for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide.

Default: None

enabled instance-attribute

enabled: NotRequired[ScalingPolicyEnabled]

Indicates whether the scaling policy is enabled or disabled. The default is enabled. For more information, see Disable a scaling policy for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide.

estimated_instance_warmup instance-attribute

estimated_instance_warmup: NotRequired[EstimatedInstanceWarmup]

Not needed if the default instance warmup is defined for the group.

The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. This warm-up period applies to instances launched due to a specific target tracking or step scaling policy. When a warm-up period is specified here, it overrides the default instance warmup.

Valid only if the policy type is TargetTrackingScaling or StepScaling.

The default is to use the value for the default instance warmup defined for the group. If default instance warmup is null, then EstimatedInstanceWarmup falls back to the value of default cooldown.

metric_aggregation_type instance-attribute

metric_aggregation_type: NotRequired[XmlStringMaxLen32]

The aggregation type for the CloudWatch metrics. The valid values are Minimum, Maximum, and Average. If the aggregation type is null, the value is treated as Average.

Valid only if the policy type is StepScaling.

min_adjustment_magnitude instance-attribute

min_adjustment_magnitude: NotRequired[MinAdjustmentMagnitude]

The minimum value to scale by when the adjustment type is PercentChangeInCapacity. For example, suppose that you create a step scaling policy to scale out an Auto Scaling group by 25 percent and you specify a MinAdjustmentMagnitude of 2. If the group has 4 instances and the scaling policy is performed, 25 percent of 4 is 1. However, because you specified a MinAdjustmentMagnitude of 2, Amazon EC2 Auto Scaling scales out the group by 2 instances.

Valid only if the policy type is StepScaling or SimpleScaling. For more information, see Scaling adjustment types in the Amazon EC2 Auto Scaling User Guide.

Some Auto Scaling groups use instance weights. In this case, set the MinAdjustmentMagnitude to a value that is at least as large as your largest instance weight.

min_adjustment_step instance-attribute

min_adjustment_step: NotRequired[MinAdjustmentStep]

Available for backward compatibility. Use MinAdjustmentMagnitude instead.

policy_name instance-attribute

policy_name: NotRequired[XmlStringMaxLen255]

The name of the policy.

policy_type instance-attribute

policy_type: NotRequired[XmlStringMaxLen64]

One of the following policy types:

  • TargetTrackingScaling

  • StepScaling

  • SimpleScaling (default)

  • PredictiveScaling

predictive_scaling_configuration instance-attribute

predictive_scaling_configuration: NotRequired[PredictiveScalingConfiguration]

A predictive scaling policy. Provides support for predefined and custom metrics.

Predefined metrics include CPU utilization, network in/out, and the Application Load Balancer request count.

For more information, see PredictiveScalingConfiguration in the Amazon EC2 Auto Scaling API Reference.

Required if the policy type is PredictiveScaling.

scaling_adjustment instance-attribute

scaling_adjustment: NotRequired[PolicyIncrement]

The amount by which to scale, based on the specified adjustment type. A positive value adds to the current capacity while a negative number removes from the current capacity. For exact capacity, you must specify a non-negative value.

Required if the policy type is SimpleScaling. (Not used with any other policy type.)

step_adjustments instance-attribute

step_adjustments: NotRequired[StepAdjustments]

A set of adjustments that enable you to scale based on the size of the alarm breach.

Required if the policy type is StepScaling. (Not used with any other policy type.)

target_tracking_configuration instance-attribute

target_tracking_configuration: NotRequired[TargetTrackingConfiguration]

A target tracking scaling policy. Provides support for predefined or custom metrics.

The following predefined metrics are available:

  • ASGAverageCPUUtilization

  • ASGAverageNetworkIn

  • ASGAverageNetworkOut

  • ALBRequestCountPerTarget

If you specify ALBRequestCountPerTarget for the metric, you must specify the ResourceLabel property with the PredefinedMetricSpecification.

For more information, see TargetTrackingConfiguration in the Amazon EC2 Auto Scaling API Reference.

Required if the policy type is TargetTrackingScaling.