Skip to content

AWS::ApplicationAutoScaling::ScalingPolicy

The AWS::ApplicationAutoScaling::ScalingPolicy resource defines a scaling policy that Application Auto Scaling uses to adjust the capacity of a scalable ...

Generated by cfn-typegen --out cfn_types AWS::ApplicationAutoScaling::ScalingPolicy into cfn_types/applicationautoscaling.py:

# Generated by cfn-typegen from the CloudFormation registry schemas. Do not edit.
# fmt: off
# ruff: noqa
"""AWS::ApplicationAutoScaling resources."""

from collections.abc import Sequence
from typing import Any, Literal, NotRequired, Unpack
from typing_extensions import TypedDict
from cfn_typed.base import DeletionPolicy, DependsOn, ResourceAttrs, UpdateReplacePolicy, build
from cfn_typed.intrinsics import Expr


CONSTRAINTS:dict[str,Any]={
}


ATTRIBUTES:dict[str,Any]={"AWS::ApplicationAutoScaling::ScalingPolicy":["Arn","ScalableDimension"]}


RULES:dict[str,Any]={}
Nested types (25)

These are defined above the properties in the generated module.

class ScalingPolicyTargetTrackingMetricDimension(TypedDict, closed=True):
    '``TargetTrackingMetricDimension`` specifies a name/value pair that is part of the identity of a CloudWatch metric for the ``Dimensions`` property of the [AWS...'
    Value: NotRequired[Expr[str]]
    'The value of the dimension.'
    Name: NotRequired[Expr[str]]
    'The name of the dimension.'


class ScalingPolicyTargetTrackingMetric(TypedDict, closed=True):
    'Represents a specific metric for a target tracking scaling policy for Application Auto Scaling.'
    MetricName: NotRequired[Expr[str]]
    'The name of the metric.'
    Dimensions: NotRequired[Expr[Sequence[Expr[ScalingPolicyTargetTrackingMetricDimension]]]]
    'The dimensions for the metric.'
    Namespace: NotRequired[Expr[str]]
    'The namespace of the metric.'


class ScalingPolicyTargetTrackingMetricStat(TypedDict, closed=True):
    'This structure defines the CloudWatch metric to return, along with the statistic and unit.'
    Stat: NotRequired[Expr[str]]
    'The statistic to return.'
    Metric: NotRequired[Expr[ScalingPolicyTargetTrackingMetric]]
    'The CloudWatch metric to return, including the metric name, namespace, and dimensions.'
    Unit: NotRequired[Expr[str]]
    'The unit to use for the returned data points.'


class ScalingPolicyTargetTrackingMetricDataQuery(TypedDict, closed=True):
    'The metric data to return.'
    ReturnData: NotRequired[Expr[bool]]
    'Indicates whether to return the timestamps and raw data values of this metric.'
    Expression: NotRequired[Expr[str]]
    'The math expression to perform on the returned data, if this object is performing a math expression.'
    Label: NotRequired[Expr[str]]
    'A human-readable label for this metric or expression.'
    MetricStat: NotRequired[Expr[ScalingPolicyTargetTrackingMetricStat]]
    'Information about the metric data to return.'
    Id: NotRequired[Expr[str]]
    "A short name that identifies the object's results in the response."


class ScalingPolicyMetricDimension(TypedDict, closed=True):
    '``MetricDimension`` specifies a name/value pair that is part of the identity of a CloudWatch metric for the ``Dimensions`` property of the [AWS::ApplicationA...'
    Value: Expr[str]
    'The value of the dimension.'
    Name: Expr[str]
    'The name of the dimension.'


class ScalingPolicyCustomizedMetricSpecification(TypedDict, closed=True):
    'Contains customized metric specification information for a target tracking scaling policy for Application Auto Scaling.'
    MetricName: NotRequired[Expr[str]]
    'The name of the metric.'
    Metrics: NotRequired[Expr[Sequence[Expr[ScalingPolicyTargetTrackingMetricDataQuery]]]]
    'The metrics to include in the target tracking scaling policy, as a metric data query.'
    Statistic: NotRequired[Expr[str]]
    'The statistic of the metric.'
    Dimensions: NotRequired[Expr[Sequence[Expr[ScalingPolicyMetricDimension]]]]
    'The dimensions of the metric.'
    Unit: NotRequired[Expr[str]]
    'The unit of the metric.'
    Namespace: NotRequired[Expr[str]]
    'The namespace of the metric.'


class ScalingPolicyPredefinedMetricSpecification(TypedDict, closed=True):
    'Contains predefined metric specification information for a target tracking scaling policy for Application Auto Scaling.'
    PredefinedMetricType: Expr[str]
    'The metric type.'
    ResourceLabel: NotRequired[Expr[str]]
    'Identifies the resource associated with the metric type.'


class ScalingPolicyTargetTrackingScalingPolicyConfiguration(TypedDict, closed=True):
    '``TargetTrackingScalingPolicyConfiguration`` is a property of the [AWS::ApplicationAutoScaling::ScalingPolicy](https://docs.aws.amazon.com/AWSCloudFormation/...'
    ScaleOutCooldown: NotRequired[Expr[int]]
    'The amount of time, in seconds, to wait for a previous scale-out activity to take effect.'
    TargetValue: Expr[float]
    'The target value for the metric.'
    CustomizedMetricSpecification: NotRequired[Expr[ScalingPolicyCustomizedMetricSpecification]]
    'A customized metric.'
    DisableScaleIn: NotRequired[Expr[bool]]
    'Indicates whether scale in by the target tracking scaling policy is disabled.'
    ScaleInCooldown: NotRequired[Expr[int]]
    'The amount of time, in seconds, after a scale-in activity completes before another scale-in activity can start.'
    PredefinedMetricSpecification: NotRequired[Expr[ScalingPolicyPredefinedMetricSpecification]]
    'A predefined metric.'


class ScalingPolicyStepAdjustment(TypedDict, closed=True):
    '``StepAdjustment`` specifies a step adjustment for the ``StepAdjustments`` property of the [AWS::ApplicationAutoScaling::ScalingPolicy StepScalingPolicyConfi...'
    MetricIntervalUpperBound: NotRequired[Expr[float]]
    'The upper bound for the difference between the alarm threshold and the CloudWatch metric.'
    MetricIntervalLowerBound: NotRequired[Expr[float]]
    'The lower bound for the difference between the alarm threshold and the CloudWatch metric.'
    ScalingAdjustment: Expr[int]
    'The amount by which to scale.'


class ScalingPolicyStepScalingPolicyConfiguration(TypedDict, closed=True):
    '``StepScalingPolicyConfiguration`` is a property of the [AWS::ApplicationAutoScaling::ScalingPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/Use...'
    MetricAggregationType: NotRequired[Expr[str]]
    'The aggregation type for the CloudWatch metrics.'
    Cooldown: NotRequired[Expr[int]]
    'The amount of time, in seconds, to wait for a previous scaling activity to take effect.'
    StepAdjustments: NotRequired[Expr[Sequence[Expr[ScalingPolicyStepAdjustment]]]]
    'A set of adjustments that enable you to scale based on the size of the alarm breach.'
    MinAdjustmentMagnitude: NotRequired[Expr[int]]
    'The minimum value to scale by when the adjustment type is ``PercentChangeInCapacity``.'
    AdjustmentType: NotRequired[Expr[str]]
    'Specifies whether the ``ScalingAdjustment`` value in the ``StepAdjustment`` property is an absolute number or a percentage of the current capacity.'


class ScalingPolicyPredictiveScalingMetricDimension(TypedDict, closed=True):
    'Describes the dimension of a metric.'
    Value: NotRequired[Expr[str]]
    'The value of the dimension.'
    Name: NotRequired[Expr[str]]
    'The name of the dimension.'


class ScalingPolicyPredictiveScalingMetric(TypedDict, closed=True):
    'Describes the scaling metric.'
    MetricName: NotRequired[Expr[str]]
    'The name of the metric.'
    Dimensions: NotRequired[Expr[Sequence[Expr[ScalingPolicyPredictiveScalingMetricDimension]]]]
    'Describes the dimensions of the metric.'
    Namespace: NotRequired[Expr[str]]
    'The namespace of the metric.'


class ScalingPolicyPredictiveScalingMetricStat(TypedDict, closed=True):
    'This structure defines the CloudWatch metric to return, along with the statistic and unit.'
    Stat: NotRequired[Expr[str]]
    'The statistic to return.'
    Metric: NotRequired[Expr[ScalingPolicyPredictiveScalingMetric]]
    'The CloudWatch metric to return, including the metric name, namespace, and dimensions.'
    Unit: NotRequired[Expr[str]]
    'The unit to use for the returned data points.'


class ScalingPolicyPredictiveScalingMetricDataQuery(TypedDict, closed=True):
    'The metric data to return.'
    ReturnData: NotRequired[Expr[bool]]
    'Indicates whether to return the timestamps and raw data values of this metric.'
    Expression: NotRequired[Expr[str]]
    'The math expression to perform on the returned data, if this object is performing a math expression.'
    Label: NotRequired[Expr[str]]
    'A human-readable label for this metric or expression.'
    MetricStat: NotRequired[Expr[ScalingPolicyPredictiveScalingMetricStat]]
    'Information about the metric data to return.'
    Id: NotRequired[Expr[str]]
    "A short name that identifies the object's results in the response."


class ScalingPolicyPredictiveScalingCustomizedLoadMetric(TypedDict, closed=True):
    'The customized load metric specification.'
    MetricDataQueries: Expr[Sequence[Expr[ScalingPolicyPredictiveScalingMetricDataQuery]]]


class ScalingPolicyPredictiveScalingPredefinedLoadMetric(TypedDict, closed=True):
    'Describes a load metric for a predictive scaling policy.'
    PredefinedMetricType: Expr[str]
    'The metric type.'
    ResourceLabel: NotRequired[Expr[str]]
    'A label that uniquely identifies a target group.'


class ScalingPolicyPredictiveScalingPredefinedScalingMetric(TypedDict, closed=True):
    'Describes a scaling metric for a predictive scaling policy.'
    PredefinedMetricType: Expr[str]
    'The metric type.'
    ResourceLabel: NotRequired[Expr[str]]
    'A label that uniquely identifies a specific target group from which to determine the average request count.'


class ScalingPolicyPredictiveScalingCustomizedCapacityMetric(TypedDict, closed=True):
    'Represents a CloudWatch metric of your choosing for a predictive scaling policy.'
    MetricDataQueries: Expr[Sequence[Expr[ScalingPolicyPredictiveScalingMetricDataQuery]]]
    'One or more metric data queries to provide data points for a metric specification.'


class ScalingPolicyPredictiveScalingCustomizedScalingMetric(TypedDict, closed=True):
    'One or more metric data queries to provide data points for a metric specification.'
    MetricDataQueries: Expr[Sequence[Expr[ScalingPolicyPredictiveScalingMetricDataQuery]]]
    'One or more metric data queries to provide data points for a metric specification.'


class ScalingPolicyPredictiveScalingPredefinedMetricPair(TypedDict, closed=True):
    'Represents a metric pair for a predictive scaling policy.'
    PredefinedMetricType: Expr[str]
    'Indicates which metrics to use.'
    ResourceLabel: NotRequired[Expr[str]]
    'A label that uniquely identifies a specific target group from which to determine the total and average request count.'


class ScalingPolicyPredictiveScalingMetricSpecification(TypedDict, closed=True):
    'This structure specifies the metrics and target utilization settings for a predictive scaling policy.'
    CustomizedLoadMetricSpecification: NotRequired[Expr[ScalingPolicyPredictiveScalingCustomizedLoadMetric]]
    'The customized load metric specification.'
    PredefinedLoadMetricSpecification: NotRequired[Expr[ScalingPolicyPredictiveScalingPredefinedLoadMetric]]
    'The predefined load metric specification.'
    TargetValue: Expr[float]
    'Specifies the target utilization.'
    PredefinedScalingMetricSpecification: NotRequired[Expr[ScalingPolicyPredictiveScalingPredefinedScalingMetric]]
    'The predefined scaling metric specification.'
    CustomizedCapacityMetricSpecification: NotRequired[Expr[ScalingPolicyPredictiveScalingCustomizedCapacityMetric]]
    'The customized capacity metric specification.'
    CustomizedScalingMetricSpecification: NotRequired[Expr[ScalingPolicyPredictiveScalingCustomizedScalingMetric]]
    'The customized scaling metric specification.'
    PredefinedMetricPairSpecification: NotRequired[Expr[ScalingPolicyPredictiveScalingPredefinedMetricPair]]
    'The predefined metric pair specification that determines the appropriate scaling metric and load metric to use.'


class ScalingPolicyPredictiveScalingPolicyConfiguration(TypedDict, closed=True):
    'Represents a predictive scaling policy configuration.'
    MaxCapacityBreachBehavior: NotRequired[Expr[str]]
    'Defines the behavior that should be applied if the forecast capacity approaches or exceeds the maximum capacity.'
    MaxCapacityBuffer: NotRequired[Expr[int]]
    'The size of the capacity buffer to use when the forecast capacity is close to or exceeds the maximum capacity.'
    Mode: NotRequired[Expr[str]]
    'The predictive scaling mode.'
    MetricSpecifications: Expr[Sequence[Expr[ScalingPolicyPredictiveScalingMetricSpecification]]]
    'This structure includes the metrics and target utilization to use for predictive scaling.'
    SchedulingBufferTime: NotRequired[Expr[int]]
    'The amount of time, in seconds, that the start time can be advanced.'


class ScalingPolicyProps(TypedDict, closed=True):
    'The ``AWS::ApplicationAutoScaling::ScalingPolicy`` resource defines a scaling policy that Application Auto Scaling uses to adjust the capacity of a scalable ...'
    PolicyType: Expr[str]
    'The scaling policy type.'
    ResourceId: NotRequired[Expr[str]]
    'The identifier of the resource associated with the scaling policy.'
    ScalingTargetId: NotRequired[Expr[str]]
    'The CloudFormation-generated ID of an Application Auto Scaling scalable target.'
    PolicyName: Expr[str]
    'The name of the scaling policy.'
    ServiceNamespace: NotRequired[Expr[str]]
    'The namespace of the AWS service that provides the resource, or a ``custom-resource``.'
    ScalableDimension: NotRequired[Expr[str]]
    'The scalable dimension.'
    TargetTrackingScalingPolicyConfiguration: NotRequired[Expr[ScalingPolicyTargetTrackingScalingPolicyConfiguration]]
    'A target tracking scaling policy.'
    StepScalingPolicyConfiguration: NotRequired[Expr[ScalingPolicyStepScalingPolicyConfiguration]]
    'A step scaling policy.'
    PredictiveScalingPolicyConfiguration: NotRequired[Expr[ScalingPolicyPredictiveScalingPolicyConfiguration]]
    'The predictive scaling policy configuration.'


class ScalingPolicy(ResourceAttrs):
    'The ``AWS::ApplicationAutoScaling::ScalingPolicy`` resource defines a scaling policy that Application Auto Scaling uses to adjust the capacity of a scalable ...'
    Type: Literal['AWS::ApplicationAutoScaling::ScalingPolicy']
    Properties: ScalingPolicyProps


def scaling_policy(
    *,
    depends_on: DependsOn | None = None,
    deletion_policy: DeletionPolicy | None = None,
    update_replace_policy: UpdateReplacePolicy | None = None,
    condition: str | None = None,
    metadata: dict[str, Any] | None = None,
    **props: Unpack[ScalingPolicyProps],
) -> ScalingPolicy:
    return build('AWS::ApplicationAutoScaling::ScalingPolicy', props, depends_on, deletion_policy, update_replace_policy, condition, metadata)

Attributes

Read-only values for get_att(logical_id, attribute). They are not accepted as inputs.

  • Arn