CfnScalingPolicyPropsMixin

class aws_cdk.mixins_preview.aws_applicationautoscaling.mixins.CfnScalingPolicyPropsMixin(props, *, strategy=None)

Bases: Mixin

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

For more information, see Target tracking scaling policies and Step scaling policies in the Application Auto Scaling User Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-applicationautoscaling-scalingpolicy.html

CloudformationResource:

AWS::ApplicationAutoScaling::ScalingPolicy

Mixin:

true

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview import mixins
from aws_cdk.mixins_preview.aws_applicationautoscaling import mixins as applicationautoscaling_mixins

cfn_scaling_policy_props_mixin = applicationautoscaling_mixins.CfnScalingPolicyPropsMixin(applicationautoscaling_mixins.CfnScalingPolicyMixinProps(
    policy_name="policyName",
    policy_type="policyType",
    predictive_scaling_policy_configuration=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingPolicyConfigurationProperty(
        max_capacity_breach_behavior="maxCapacityBreachBehavior",
        max_capacity_buffer=123,
        metric_specifications=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricSpecificationProperty(
            customized_capacity_metric_specification=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingCustomizedCapacityMetricProperty(
                metric_data_queries=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricDataQueryProperty(
                    expression="expression",
                    id="id",
                    label="label",
                    metric_stat=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricStatProperty(
                        metric=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricProperty(
                            dimensions=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricDimensionProperty(
                                name="name",
                                value="value"
                            )],
                            metric_name="metricName",
                            namespace="namespace"
                        ),
                        stat="stat",
                        unit="unit"
                    ),
                    return_data=False
                )]
            ),
            customized_load_metric_specification=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingCustomizedLoadMetricProperty(
                metric_data_queries=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricDataQueryProperty(
                    expression="expression",
                    id="id",
                    label="label",
                    metric_stat=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricStatProperty(
                        metric=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricProperty(
                            dimensions=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricDimensionProperty(
                                name="name",
                                value="value"
                            )],
                            metric_name="metricName",
                            namespace="namespace"
                        ),
                        stat="stat",
                        unit="unit"
                    ),
                    return_data=False
                )]
            ),
            customized_scaling_metric_specification=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingCustomizedScalingMetricProperty(
                metric_data_queries=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricDataQueryProperty(
                    expression="expression",
                    id="id",
                    label="label",
                    metric_stat=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricStatProperty(
                        metric=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricProperty(
                            dimensions=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricDimensionProperty(
                                name="name",
                                value="value"
                            )],
                            metric_name="metricName",
                            namespace="namespace"
                        ),
                        stat="stat",
                        unit="unit"
                    ),
                    return_data=False
                )]
            ),
            predefined_load_metric_specification=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingPredefinedLoadMetricProperty(
                predefined_metric_type="predefinedMetricType",
                resource_label="resourceLabel"
            ),
            predefined_metric_pair_specification=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingPredefinedMetricPairProperty(
                predefined_metric_type="predefinedMetricType",
                resource_label="resourceLabel"
            ),
            predefined_scaling_metric_specification=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingPredefinedScalingMetricProperty(
                predefined_metric_type="predefinedMetricType",
                resource_label="resourceLabel"
            ),
            target_value=123
        )],
        mode="mode",
        scheduling_buffer_time=123
    ),
    resource_id="resourceId",
    scalable_dimension="scalableDimension",
    scaling_target_id="scalingTargetId",
    service_namespace="serviceNamespace",
    step_scaling_policy_configuration=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.StepScalingPolicyConfigurationProperty(
        adjustment_type="adjustmentType",
        cooldown=123,
        metric_aggregation_type="metricAggregationType",
        min_adjustment_magnitude=123,
        step_adjustments=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.StepAdjustmentProperty(
            metric_interval_lower_bound=123,
            metric_interval_upper_bound=123,
            scaling_adjustment=123
        )]
    ),
    target_tracking_scaling_policy_configuration=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.TargetTrackingScalingPolicyConfigurationProperty(
        customized_metric_specification=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.CustomizedMetricSpecificationProperty(
            dimensions=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.MetricDimensionProperty(
                name="name",
                value="value"
            )],
            metric_name="metricName",
            metrics=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.TargetTrackingMetricDataQueryProperty(
                expression="expression",
                id="id",
                label="label",
                metric_stat=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.TargetTrackingMetricStatProperty(
                    metric=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.TargetTrackingMetricProperty(
                        dimensions=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.TargetTrackingMetricDimensionProperty(
                            name="name",
                            value="value"
                        )],
                        metric_name="metricName",
                        namespace="namespace"
                    ),
                    stat="stat",
                    unit="unit"
                ),
                return_data=False
            )],
            namespace="namespace",
            statistic="statistic",
            unit="unit"
        ),
        disable_scale_in=False,
        predefined_metric_specification=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredefinedMetricSpecificationProperty(
            predefined_metric_type="predefinedMetricType",
            resource_label="resourceLabel"
        ),
        scale_in_cooldown=123,
        scale_out_cooldown=123,
        target_value=123
    )
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::ApplicationAutoScaling::ScalingPolicy.

Parameters:

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['policyName', 'policyType', 'predictiveScalingPolicyConfiguration', 'resourceId', 'scalableDimension', 'scalingTargetId', 'serviceNamespace', 'stepScalingPolicyConfiguration', 'targetTrackingScalingPolicyConfiguration']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

CustomizedMetricSpecificationProperty

class CfnScalingPolicyPropsMixin.CustomizedMetricSpecificationProperty(*, dimensions=None, metric_name=None, metrics=None, namespace=None, statistic=None, unit=None)

Bases: object

Contains customized metric specification information for a target tracking scaling policy for Application Auto Scaling.

For information about the available metrics for a service, see AWS services that publish CloudWatch metrics in the Amazon CloudWatch User Guide .

To create your customized metric specification:

  • Add values for each required parameter from CloudWatch. You can use an existing metric, or a new metric that you create. To use your own metric, you must first publish the metric to CloudWatch. For more information, see Publish custom metrics in the Amazon CloudWatch User Guide .

  • Choose a metric that changes proportionally with capacity. The value of the metric should increase or decrease in inverse proportion to the number of capacity units. That is, the value of the metric should decrease when capacity increases, and increase when capacity decreases.

For an example of how creating new metrics can be useful, see Scaling based on Amazon SQS in the Amazon EC2 Auto Scaling User Guide . This topic mentions Auto Scaling groups, but the same scenario for Amazon SQS can apply to the target tracking scaling policies that you create for a Spot Fleet by using Application Auto Scaling.

For more information about the CloudWatch terminology below, see Amazon CloudWatch concepts .

CustomizedMetricSpecification is a property of the AWS::ApplicationAutoScaling::ScalingPolicy TargetTrackingScalingPolicyConfiguration property type.

Parameters:
  • dimensions (Union[IResolvable, Sequence[Union[IResolvable, MetricDimensionProperty, Dict[str, Any]]], None]) – The dimensions of the metric. Conditional: If you published your metric with dimensions, you must specify the same dimensions in your scaling policy.

  • metric_name (Optional[str]) – The name of the metric. To get the exact metric name, namespace, and dimensions, inspect the Metric object that’s returned by a call to ListMetrics .

  • metrics (Union[IResolvable, Sequence[Union[IResolvable, TargetTrackingMetricDataQueryProperty, Dict[str, Any]]], None]) – The metrics to include in the target tracking scaling policy, as a metric data query. This can include both raw metric and metric math expressions.

  • namespace (Optional[str]) – The namespace of the metric.

  • statistic (Optional[str]) – The statistic of the metric.

  • unit (Optional[str]) – The unit of the metric. For a complete list of the units that CloudWatch supports, see the MetricDatum data type in the Amazon CloudWatch API Reference .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-customizedmetricspecification.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_applicationautoscaling import mixins as applicationautoscaling_mixins

customized_metric_specification_property = applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.CustomizedMetricSpecificationProperty(
    dimensions=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.MetricDimensionProperty(
        name="name",
        value="value"
    )],
    metric_name="metricName",
    metrics=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.TargetTrackingMetricDataQueryProperty(
        expression="expression",
        id="id",
        label="label",
        metric_stat=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.TargetTrackingMetricStatProperty(
            metric=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.TargetTrackingMetricProperty(
                dimensions=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.TargetTrackingMetricDimensionProperty(
                    name="name",
                    value="value"
                )],
                metric_name="metricName",
                namespace="namespace"
            ),
            stat="stat",
            unit="unit"
        ),
        return_data=False
    )],
    namespace="namespace",
    statistic="statistic",
    unit="unit"
)

Attributes

dimensions

The dimensions of the metric.

Conditional: If you published your metric with dimensions, you must specify the same dimensions in your scaling policy.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-customizedmetricspecification.html#cfn-applicationautoscaling-scalingpolicy-customizedmetricspecification-dimensions

metric_name

The name of the metric.

To get the exact metric name, namespace, and dimensions, inspect the Metric object that’s returned by a call to ListMetrics .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-customizedmetricspecification.html#cfn-applicationautoscaling-scalingpolicy-customizedmetricspecification-metricname

metrics

The metrics to include in the target tracking scaling policy, as a metric data query.

This can include both raw metric and metric math expressions.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-customizedmetricspecification.html#cfn-applicationautoscaling-scalingpolicy-customizedmetricspecification-metrics

namespace

The namespace of the metric.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-customizedmetricspecification.html#cfn-applicationautoscaling-scalingpolicy-customizedmetricspecification-namespace

statistic

The statistic of the metric.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-customizedmetricspecification.html#cfn-applicationautoscaling-scalingpolicy-customizedmetricspecification-statistic

unit

The unit of the metric.

For a complete list of the units that CloudWatch supports, see the MetricDatum data type in the Amazon CloudWatch API Reference .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-customizedmetricspecification.html#cfn-applicationautoscaling-scalingpolicy-customizedmetricspecification-unit

MetricDimensionProperty

class CfnScalingPolicyPropsMixin.MetricDimensionProperty(*, name=None, value=None)

Bases: object

MetricDimension specifies a name/value pair that is part of the identity of a CloudWatch metric for the Dimensions property of the AWS::ApplicationAutoScaling::ScalingPolicy CustomizedMetricSpecification property type. Duplicate dimensions are not allowed.

Parameters:
  • name (Optional[str]) – The name of the dimension.

  • value (Optional[str]) – The value of the dimension.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-metricdimension.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_applicationautoscaling import mixins as applicationautoscaling_mixins

metric_dimension_property = applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.MetricDimensionProperty(
    name="name",
    value="value"
)

Attributes

name

The name of the dimension.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-metricdimension.html#cfn-applicationautoscaling-scalingpolicy-metricdimension-name

value

The value of the dimension.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-metricdimension.html#cfn-applicationautoscaling-scalingpolicy-metricdimension-value

PredefinedMetricSpecificationProperty

class CfnScalingPolicyPropsMixin.PredefinedMetricSpecificationProperty(*, predefined_metric_type=None, resource_label=None)

Bases: object

Contains predefined metric specification information for a target tracking scaling policy for Application Auto Scaling.

PredefinedMetricSpecification is a property of the AWS::ApplicationAutoScaling::ScalingPolicy TargetTrackingScalingPolicyConfiguration property type.

Parameters:
  • predefined_metric_type (Optional[str]) – The metric type. The ALBRequestCountPerTarget metric type applies only to Spot fleet requests and ECS services.

  • resource_label (Optional[str]) – Identifies the resource associated with the metric type. You can’t specify a resource label unless the metric type is ALBRequestCountPerTarget and there is a target group attached to the Spot Fleet or ECS service. You create the resource label by appending the final portion of the load balancer ARN and the final portion of the target group ARN into a single value, separated by a forward slash (/). The format of the resource label is: app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff . Where: - app// is the final portion of the load balancer ARN - targetgroup// is the final portion of the target group ARN. To find the ARN for an Application Load Balancer, use the DescribeLoadBalancers API operation. To find the ARN for the target group, use the DescribeTargetGroups API operation.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predefinedmetricspecification.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_applicationautoscaling import mixins as applicationautoscaling_mixins

predefined_metric_specification_property = applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredefinedMetricSpecificationProperty(
    predefined_metric_type="predefinedMetricType",
    resource_label="resourceLabel"
)

Attributes

predefined_metric_type

The metric type.

The ALBRequestCountPerTarget metric type applies only to Spot fleet requests and ECS services.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predefinedmetricspecification.html#cfn-applicationautoscaling-scalingpolicy-predefinedmetricspecification-predefinedmetrictype

resource_label

Identifies the resource associated with the metric type.

You can’t specify a resource label unless the metric type is ALBRequestCountPerTarget and there is a target group attached to the Spot Fleet or ECS service.

You create the resource label by appending the final portion of the load balancer ARN and the final portion of the target group ARN into a single value, separated by a forward slash (/). The format of the resource label is:

app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff .

Where:

  • app// is the final portion of the load balancer ARN

  • targetgroup// is the final portion of the target group ARN.

To find the ARN for an Application Load Balancer, use the DescribeLoadBalancers API operation. To find the ARN for the target group, use the DescribeTargetGroups API operation.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predefinedmetricspecification.html#cfn-applicationautoscaling-scalingpolicy-predefinedmetricspecification-resourcelabel

PredictiveScalingCustomizedCapacityMetricProperty

class CfnScalingPolicyPropsMixin.PredictiveScalingCustomizedCapacityMetricProperty(*, metric_data_queries=None)

Bases: object

Represents a CloudWatch metric of your choosing for a predictive scaling policy.

Parameters:

metric_data_queries (Union[IResolvable, Sequence[Union[IResolvable, PredictiveScalingMetricDataQueryProperty, Dict[str, Any]]], None]) – One or more metric data queries to provide data points for a metric specification.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingcustomizedcapacitymetric.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_applicationautoscaling import mixins as applicationautoscaling_mixins

predictive_scaling_customized_capacity_metric_property = applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingCustomizedCapacityMetricProperty(
    metric_data_queries=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricDataQueryProperty(
        expression="expression",
        id="id",
        label="label",
        metric_stat=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricStatProperty(
            metric=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricProperty(
                dimensions=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricDimensionProperty(
                    name="name",
                    value="value"
                )],
                metric_name="metricName",
                namespace="namespace"
            ),
            stat="stat",
            unit="unit"
        ),
        return_data=False
    )]
)

Attributes

metric_data_queries

One or more metric data queries to provide data points for a metric specification.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingcustomizedcapacitymetric.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingcustomizedcapacitymetric-metricdataqueries

PredictiveScalingCustomizedLoadMetricProperty

class CfnScalingPolicyPropsMixin.PredictiveScalingCustomizedLoadMetricProperty(*, metric_data_queries=None)

Bases: object

The customized load metric specification.

Parameters:

metric_data_queries (Union[IResolvable, Sequence[Union[IResolvable, PredictiveScalingMetricDataQueryProperty, Dict[str, Any]]], None])

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingcustomizedloadmetric.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_applicationautoscaling import mixins as applicationautoscaling_mixins

predictive_scaling_customized_load_metric_property = applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingCustomizedLoadMetricProperty(
    metric_data_queries=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricDataQueryProperty(
        expression="expression",
        id="id",
        label="label",
        metric_stat=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricStatProperty(
            metric=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricProperty(
                dimensions=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricDimensionProperty(
                    name="name",
                    value="value"
                )],
                metric_name="metricName",
                namespace="namespace"
            ),
            stat="stat",
            unit="unit"
        ),
        return_data=False
    )]
)

Attributes

metric_data_queries

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingcustomizedloadmetric.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingcustomizedloadmetric-metricdataqueries

Type:

see

PredictiveScalingCustomizedScalingMetricProperty

class CfnScalingPolicyPropsMixin.PredictiveScalingCustomizedScalingMetricProperty(*, metric_data_queries=None)

Bases: object

One or more metric data queries to provide data points for a metric specification.

Parameters:

metric_data_queries (Union[IResolvable, Sequence[Union[IResolvable, PredictiveScalingMetricDataQueryProperty, Dict[str, Any]]], None]) – One or more metric data queries to provide data points for a metric specification.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingcustomizedscalingmetric.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_applicationautoscaling import mixins as applicationautoscaling_mixins

predictive_scaling_customized_scaling_metric_property = applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingCustomizedScalingMetricProperty(
    metric_data_queries=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricDataQueryProperty(
        expression="expression",
        id="id",
        label="label",
        metric_stat=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricStatProperty(
            metric=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricProperty(
                dimensions=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricDimensionProperty(
                    name="name",
                    value="value"
                )],
                metric_name="metricName",
                namespace="namespace"
            ),
            stat="stat",
            unit="unit"
        ),
        return_data=False
    )]
)

Attributes

metric_data_queries

One or more metric data queries to provide data points for a metric specification.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingcustomizedscalingmetric.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingcustomizedscalingmetric-metricdataqueries

PredictiveScalingMetricDataQueryProperty

class CfnScalingPolicyPropsMixin.PredictiveScalingMetricDataQueryProperty(*, expression=None, id=None, label=None, metric_stat=None, return_data=None)

Bases: object

The metric data to return.

Also defines whether this call is returning data for one metric only, or whether it is performing a math expression on the values of returned metric statistics to create a new time series. A time series is a series of data points, each of which is associated with a timestamp.

Parameters:
  • expression (Optional[str]) – The math expression to perform on the returned data, if this object is performing a math expression. This expression can use the Id of the other metrics to refer to those metrics, and can also use the Id of other expressions to use the result of those expressions. Conditional: Within each MetricDataQuery object, you must specify either Expression or MetricStat , but not both.

  • id (Optional[str]) – A short name that identifies the object’s results in the response. This name must be unique among all MetricDataQuery objects specified for a single scaling policy. If you are performing math expressions on this set of data, this name represents that data and can serve as a variable in the mathematical expression. The valid characters are letters, numbers, and underscores. The first character must be a lowercase letter.

  • label (Optional[str]) – A human-readable label for this metric or expression. This is especially useful if this is a math expression, so that you know what the value represents.

  • metric_stat (Union[IResolvable, PredictiveScalingMetricStatProperty, Dict[str, Any], None]) – Information about the metric data to return. Conditional: Within each MetricDataQuery object, you must specify either Expression or MetricStat , but not both.

  • return_data (Union[bool, IResolvable, None]) – Indicates whether to return the timestamps and raw data values of this metric. If you use any math expressions, specify true for this value for only the final math expression that the metric specification is based on. You must specify false for ReturnData for all the other metrics and expressions used in the metric specification. If you are only retrieving metrics and not performing any math expressions, do not specify anything for ReturnData . This sets it to its default ( true ).

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingmetricdataquery.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_applicationautoscaling import mixins as applicationautoscaling_mixins

predictive_scaling_metric_data_query_property = applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricDataQueryProperty(
    expression="expression",
    id="id",
    label="label",
    metric_stat=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricStatProperty(
        metric=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricProperty(
            dimensions=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricDimensionProperty(
                name="name",
                value="value"
            )],
            metric_name="metricName",
            namespace="namespace"
        ),
        stat="stat",
        unit="unit"
    ),
    return_data=False
)

Attributes

expression

The math expression to perform on the returned data, if this object is performing a math expression.

This expression can use the Id of the other metrics to refer to those metrics, and can also use the Id of other expressions to use the result of those expressions.

Conditional: Within each MetricDataQuery object, you must specify either Expression or MetricStat , but not both.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingmetricdataquery.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingmetricdataquery-expression

id

A short name that identifies the object’s results in the response.

This name must be unique among all MetricDataQuery objects specified for a single scaling policy. If you are performing math expressions on this set of data, this name represents that data and can serve as a variable in the mathematical expression. The valid characters are letters, numbers, and underscores. The first character must be a lowercase letter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingmetricdataquery.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingmetricdataquery-id

label

A human-readable label for this metric or expression.

This is especially useful if this is a math expression, so that you know what the value represents.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingmetricdataquery.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingmetricdataquery-label

metric_stat

Information about the metric data to return.

Conditional: Within each MetricDataQuery object, you must specify either Expression or MetricStat , but not both.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingmetricdataquery.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingmetricdataquery-metricstat

return_data

Indicates whether to return the timestamps and raw data values of this metric.

If you use any math expressions, specify true for this value for only the final math expression that the metric specification is based on. You must specify false for ReturnData for all the other metrics and expressions used in the metric specification.

If you are only retrieving metrics and not performing any math expressions, do not specify anything for ReturnData . This sets it to its default ( true ).

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingmetricdataquery.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingmetricdataquery-returndata

PredictiveScalingMetricDimensionProperty

class CfnScalingPolicyPropsMixin.PredictiveScalingMetricDimensionProperty(*, name=None, value=None)

Bases: object

Describes the dimension of a metric.

Parameters:
  • name (Optional[str]) – The name of the dimension.

  • value (Optional[str]) – The value of the dimension.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingmetricdimension.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_applicationautoscaling import mixins as applicationautoscaling_mixins

predictive_scaling_metric_dimension_property = applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricDimensionProperty(
    name="name",
    value="value"
)

Attributes

name

The name of the dimension.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingmetricdimension.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingmetricdimension-name

value

The value of the dimension.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingmetricdimension.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingmetricdimension-value

PredictiveScalingMetricProperty

class CfnScalingPolicyPropsMixin.PredictiveScalingMetricProperty(*, dimensions=None, metric_name=None, namespace=None)

Bases: object

Describes the scaling metric.

Parameters:
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingmetric.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_applicationautoscaling import mixins as applicationautoscaling_mixins

predictive_scaling_metric_property = applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricProperty(
    dimensions=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricDimensionProperty(
        name="name",
        value="value"
    )],
    metric_name="metricName",
    namespace="namespace"
)

Attributes

dimensions

Describes the dimensions of the metric.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingmetric.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingmetric-dimensions

metric_name

The name of the metric.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingmetric.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingmetric-metricname

namespace

The namespace of the metric.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingmetric.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingmetric-namespace

PredictiveScalingMetricSpecificationProperty

class CfnScalingPolicyPropsMixin.PredictiveScalingMetricSpecificationProperty(*, customized_capacity_metric_specification=None, customized_load_metric_specification=None, customized_scaling_metric_specification=None, predefined_load_metric_specification=None, predefined_metric_pair_specification=None, predefined_scaling_metric_specification=None, target_value=None)

Bases: object

This structure specifies the metrics and target utilization settings for a predictive scaling policy.

You must specify either a metric pair, or a load metric and a scaling metric individually. Specifying a metric pair instead of individual metrics provides a simpler way to configure metrics for a scaling policy. You choose the metric pair, and the policy automatically knows the correct sum and average statistics to use for the load metric and the scaling metric.

Parameters:
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingmetricspecification.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_applicationautoscaling import mixins as applicationautoscaling_mixins

predictive_scaling_metric_specification_property = applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricSpecificationProperty(
    customized_capacity_metric_specification=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingCustomizedCapacityMetricProperty(
        metric_data_queries=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricDataQueryProperty(
            expression="expression",
            id="id",
            label="label",
            metric_stat=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricStatProperty(
                metric=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricProperty(
                    dimensions=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricDimensionProperty(
                        name="name",
                        value="value"
                    )],
                    metric_name="metricName",
                    namespace="namespace"
                ),
                stat="stat",
                unit="unit"
            ),
            return_data=False
        )]
    ),
    customized_load_metric_specification=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingCustomizedLoadMetricProperty(
        metric_data_queries=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricDataQueryProperty(
            expression="expression",
            id="id",
            label="label",
            metric_stat=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricStatProperty(
                metric=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricProperty(
                    dimensions=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricDimensionProperty(
                        name="name",
                        value="value"
                    )],
                    metric_name="metricName",
                    namespace="namespace"
                ),
                stat="stat",
                unit="unit"
            ),
            return_data=False
        )]
    ),
    customized_scaling_metric_specification=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingCustomizedScalingMetricProperty(
        metric_data_queries=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricDataQueryProperty(
            expression="expression",
            id="id",
            label="label",
            metric_stat=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricStatProperty(
                metric=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricProperty(
                    dimensions=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricDimensionProperty(
                        name="name",
                        value="value"
                    )],
                    metric_name="metricName",
                    namespace="namespace"
                ),
                stat="stat",
                unit="unit"
            ),
            return_data=False
        )]
    ),
    predefined_load_metric_specification=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingPredefinedLoadMetricProperty(
        predefined_metric_type="predefinedMetricType",
        resource_label="resourceLabel"
    ),
    predefined_metric_pair_specification=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingPredefinedMetricPairProperty(
        predefined_metric_type="predefinedMetricType",
        resource_label="resourceLabel"
    ),
    predefined_scaling_metric_specification=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingPredefinedScalingMetricProperty(
        predefined_metric_type="predefinedMetricType",
        resource_label="resourceLabel"
    ),
    target_value=123
)

Attributes

customized_capacity_metric_specification

The customized capacity metric specification.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingmetricspecification.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingmetricspecification-customizedcapacitymetricspecification

customized_load_metric_specification

The customized load metric specification.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingmetricspecification.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingmetricspecification-customizedloadmetricspecification

customized_scaling_metric_specification

The customized scaling metric specification.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingmetricspecification.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingmetricspecification-customizedscalingmetricspecification

predefined_load_metric_specification

The predefined load metric specification.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingmetricspecification.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingmetricspecification-predefinedloadmetricspecification

predefined_metric_pair_specification

The predefined metric pair specification that determines the appropriate scaling metric and load metric to use.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingmetricspecification.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingmetricspecification-predefinedmetricpairspecification

predefined_scaling_metric_specification

The predefined scaling metric specification.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingmetricspecification.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingmetricspecification-predefinedscalingmetricspecification

target_value

Specifies the target utilization.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingmetricspecification.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingmetricspecification-targetvalue

PredictiveScalingMetricStatProperty

class CfnScalingPolicyPropsMixin.PredictiveScalingMetricStatProperty(*, metric=None, stat=None, unit=None)

Bases: object

This structure defines the CloudWatch metric to return, along with the statistic and unit.

Parameters:
  • metric (Union[IResolvable, PredictiveScalingMetricProperty, Dict[str, Any], None]) –

    The CloudWatch metric to return, including the metric name, namespace, and dimensions. To get the exact metric name, namespace, and dimensions, inspect the Metric object that is returned by a call to ListMetrics .

  • stat (Optional[str]) – The statistic to return. It can include any CloudWatch statistic or extended statistic. For a list of valid values, see the table in Statistics in the Amazon CloudWatch User Guide . The most commonly used metrics for predictive scaling are Average and Sum .

  • unit (Optional[str]) –

    The unit to use for the returned data points. For a complete list of the units that CloudWatch supports, see the MetricDatum data type in the Amazon CloudWatch API Reference .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingmetricstat.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_applicationautoscaling import mixins as applicationautoscaling_mixins

predictive_scaling_metric_stat_property = applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricStatProperty(
    metric=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricProperty(
        dimensions=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricDimensionProperty(
            name="name",
            value="value"
        )],
        metric_name="metricName",
        namespace="namespace"
    ),
    stat="stat",
    unit="unit"
)

Attributes

metric

The CloudWatch metric to return, including the metric name, namespace, and dimensions.

To get the exact metric name, namespace, and dimensions, inspect the Metric object that is returned by a call to ListMetrics .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingmetricstat.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingmetricstat-metric

stat

The statistic to return.

It can include any CloudWatch statistic or extended statistic. For a list of valid values, see the table in Statistics in the Amazon CloudWatch User Guide .

The most commonly used metrics for predictive scaling are Average and Sum .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingmetricstat.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingmetricstat-stat

unit

The unit to use for the returned data points.

For a complete list of the units that CloudWatch supports, see the MetricDatum data type in the Amazon CloudWatch API Reference .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingmetricstat.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingmetricstat-unit

PredictiveScalingPolicyConfigurationProperty

class CfnScalingPolicyPropsMixin.PredictiveScalingPolicyConfigurationProperty(*, max_capacity_breach_behavior=None, max_capacity_buffer=None, metric_specifications=None, mode=None, scheduling_buffer_time=None)

Bases: object

Represents a predictive scaling policy configuration.

Predictive scaling is supported on Amazon ECS services.

Parameters:
  • max_capacity_breach_behavior (Optional[str]) – Defines the behavior that should be applied if the forecast capacity approaches or exceeds the maximum capacity. Defaults to HonorMaxCapacity if not specified.

  • max_capacity_buffer (Union[int, float, None]) – The size of the capacity buffer to use when the forecast capacity is close to or exceeds the maximum capacity. The value is specified as a percentage relative to the forecast capacity. For example, if the buffer is 10, this means a 10 percent buffer, such that if the forecast capacity is 50, and the maximum capacity is 40, then the effective maximum capacity is 55. Required if the MaxCapacityBreachBehavior property is set to IncreaseMaxCapacity , and cannot be used otherwise.

  • metric_specifications (Union[IResolvable, Sequence[Union[IResolvable, PredictiveScalingMetricSpecificationProperty, Dict[str, Any]]], None]) – This structure includes the metrics and target utilization to use for predictive scaling. This is an array, but we currently only support a single metric specification. That is, you can specify a target value and a single metric pair, or a target value and one scaling metric and one load metric.

  • mode (Optional[str]) – The predictive scaling mode. Defaults to ForecastOnly if not specified.

  • scheduling_buffer_time (Union[int, float, None]) – The amount of time, in seconds, that the start time can be advanced. The value must be less than the forecast interval duration of 3600 seconds (60 minutes). Defaults to 300 seconds if not specified.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingpolicyconfiguration.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_applicationautoscaling import mixins as applicationautoscaling_mixins

predictive_scaling_policy_configuration_property = applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingPolicyConfigurationProperty(
    max_capacity_breach_behavior="maxCapacityBreachBehavior",
    max_capacity_buffer=123,
    metric_specifications=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricSpecificationProperty(
        customized_capacity_metric_specification=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingCustomizedCapacityMetricProperty(
            metric_data_queries=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricDataQueryProperty(
                expression="expression",
                id="id",
                label="label",
                metric_stat=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricStatProperty(
                    metric=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricProperty(
                        dimensions=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricDimensionProperty(
                            name="name",
                            value="value"
                        )],
                        metric_name="metricName",
                        namespace="namespace"
                    ),
                    stat="stat",
                    unit="unit"
                ),
                return_data=False
            )]
        ),
        customized_load_metric_specification=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingCustomizedLoadMetricProperty(
            metric_data_queries=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricDataQueryProperty(
                expression="expression",
                id="id",
                label="label",
                metric_stat=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricStatProperty(
                    metric=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricProperty(
                        dimensions=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricDimensionProperty(
                            name="name",
                            value="value"
                        )],
                        metric_name="metricName",
                        namespace="namespace"
                    ),
                    stat="stat",
                    unit="unit"
                ),
                return_data=False
            )]
        ),
        customized_scaling_metric_specification=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingCustomizedScalingMetricProperty(
            metric_data_queries=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricDataQueryProperty(
                expression="expression",
                id="id",
                label="label",
                metric_stat=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricStatProperty(
                    metric=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricProperty(
                        dimensions=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingMetricDimensionProperty(
                            name="name",
                            value="value"
                        )],
                        metric_name="metricName",
                        namespace="namespace"
                    ),
                    stat="stat",
                    unit="unit"
                ),
                return_data=False
            )]
        ),
        predefined_load_metric_specification=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingPredefinedLoadMetricProperty(
            predefined_metric_type="predefinedMetricType",
            resource_label="resourceLabel"
        ),
        predefined_metric_pair_specification=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingPredefinedMetricPairProperty(
            predefined_metric_type="predefinedMetricType",
            resource_label="resourceLabel"
        ),
        predefined_scaling_metric_specification=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingPredefinedScalingMetricProperty(
            predefined_metric_type="predefinedMetricType",
            resource_label="resourceLabel"
        ),
        target_value=123
    )],
    mode="mode",
    scheduling_buffer_time=123
)

Attributes

max_capacity_breach_behavior

Defines the behavior that should be applied if the forecast capacity approaches or exceeds the maximum capacity.

Defaults to HonorMaxCapacity if not specified.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingpolicyconfiguration.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingpolicyconfiguration-maxcapacitybreachbehavior

max_capacity_buffer

The size of the capacity buffer to use when the forecast capacity is close to or exceeds the maximum capacity.

The value is specified as a percentage relative to the forecast capacity. For example, if the buffer is 10, this means a 10 percent buffer, such that if the forecast capacity is 50, and the maximum capacity is 40, then the effective maximum capacity is 55.

Required if the MaxCapacityBreachBehavior property is set to IncreaseMaxCapacity , and cannot be used otherwise.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingpolicyconfiguration.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingpolicyconfiguration-maxcapacitybuffer

metric_specifications

This structure includes the metrics and target utilization to use for predictive scaling.

This is an array, but we currently only support a single metric specification. That is, you can specify a target value and a single metric pair, or a target value and one scaling metric and one load metric.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingpolicyconfiguration.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingpolicyconfiguration-metricspecifications

mode

The predictive scaling mode.

Defaults to ForecastOnly if not specified.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingpolicyconfiguration.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingpolicyconfiguration-mode

scheduling_buffer_time

The amount of time, in seconds, that the start time can be advanced.

The value must be less than the forecast interval duration of 3600 seconds (60 minutes). Defaults to 300 seconds if not specified.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingpolicyconfiguration.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingpolicyconfiguration-schedulingbuffertime

PredictiveScalingPredefinedLoadMetricProperty

class CfnScalingPolicyPropsMixin.PredictiveScalingPredefinedLoadMetricProperty(*, predefined_metric_type=None, resource_label=None)

Bases: object

Describes a load metric for a predictive scaling policy.

When returned in the output of DescribePolicies , it indicates that a predictive scaling policy uses individually specified load and scaling metrics instead of a metric pair.

The following predefined metrics are available for predictive scaling:

  • ECSServiceAverageCPUUtilization

  • ECSServiceAverageMemoryUtilization

  • ECSServiceCPUUtilization

  • ECSServiceMemoryUtilization

  • ECSServiceTotalCPUUtilization

  • ECSServiceTotalMemoryUtilization

  • ALBRequestCount

  • ALBRequestCountPerTarget

  • TotalALBRequestCount

Parameters:
  • predefined_metric_type (Optional[str]) – The metric type.

  • resource_label (Optional[str]) – A label that uniquely identifies a target group.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingpredefinedloadmetric.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_applicationautoscaling import mixins as applicationautoscaling_mixins

predictive_scaling_predefined_load_metric_property = applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingPredefinedLoadMetricProperty(
    predefined_metric_type="predefinedMetricType",
    resource_label="resourceLabel"
)

Attributes

predefined_metric_type

The metric type.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingpredefinedloadmetric.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingpredefinedloadmetric-predefinedmetrictype

resource_label

A label that uniquely identifies a target group.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingpredefinedloadmetric.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingpredefinedloadmetric-resourcelabel

PredictiveScalingPredefinedMetricPairProperty

class CfnScalingPolicyPropsMixin.PredictiveScalingPredefinedMetricPairProperty(*, predefined_metric_type=None, resource_label=None)

Bases: object

Represents a metric pair for a predictive scaling policy.

The following predefined metrics are available for predictive scaling:

  • ECSServiceAverageCPUUtilization

  • ECSServiceAverageMemoryUtilization

  • ECSServiceCPUUtilization

  • ECSServiceMemoryUtilization

  • ECSServiceTotalCPUUtilization

  • ECSServiceTotalMemoryUtilization

  • ALBRequestCount

  • ALBRequestCountPerTarget

  • TotalALBRequestCount

Parameters:
  • predefined_metric_type (Optional[str]) – Indicates which metrics to use. There are two different types of metrics for each metric type: one is a load metric and one is a scaling metric.

  • resource_label (Optional[str]) – A label that uniquely identifies a specific target group from which to determine the total and average request count.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingpredefinedmetricpair.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_applicationautoscaling import mixins as applicationautoscaling_mixins

predictive_scaling_predefined_metric_pair_property = applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingPredefinedMetricPairProperty(
    predefined_metric_type="predefinedMetricType",
    resource_label="resourceLabel"
)

Attributes

predefined_metric_type

Indicates which metrics to use.

There are two different types of metrics for each metric type: one is a load metric and one is a scaling metric.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingpredefinedmetricpair.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingpredefinedmetricpair-predefinedmetrictype

resource_label

A label that uniquely identifies a specific target group from which to determine the total and average request count.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingpredefinedmetricpair.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingpredefinedmetricpair-resourcelabel

PredictiveScalingPredefinedScalingMetricProperty

class CfnScalingPolicyPropsMixin.PredictiveScalingPredefinedScalingMetricProperty(*, predefined_metric_type=None, resource_label=None)

Bases: object

Describes a scaling metric for a predictive scaling policy.

When returned in the output of DescribePolicies , it indicates that a predictive scaling policy uses individually specified load and scaling metrics instead of a metric pair.

The following predefined metrics are available for predictive scaling:

  • ECSServiceAverageCPUUtilization

  • ECSServiceAverageMemoryUtilization

  • ECSServiceCPUUtilization

  • ECSServiceMemoryUtilization

  • ECSServiceTotalCPUUtilization

  • ECSServiceTotalMemoryUtilization

  • ALBRequestCount

  • ALBRequestCountPerTarget

  • TotalALBRequestCount

Parameters:
  • predefined_metric_type (Optional[str]) – The metric type.

  • resource_label (Optional[str]) – A label that uniquely identifies a specific target group from which to determine the average request count.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingpredefinedscalingmetric.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_applicationautoscaling import mixins as applicationautoscaling_mixins

predictive_scaling_predefined_scaling_metric_property = applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredictiveScalingPredefinedScalingMetricProperty(
    predefined_metric_type="predefinedMetricType",
    resource_label="resourceLabel"
)

Attributes

predefined_metric_type

The metric type.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingpredefinedscalingmetric.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingpredefinedscalingmetric-predefinedmetrictype

resource_label

A label that uniquely identifies a specific target group from which to determine the average request count.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-predictivescalingpredefinedscalingmetric.html#cfn-applicationautoscaling-scalingpolicy-predictivescalingpredefinedscalingmetric-resourcelabel

StepAdjustmentProperty

class CfnScalingPolicyPropsMixin.StepAdjustmentProperty(*, metric_interval_lower_bound=None, metric_interval_upper_bound=None, scaling_adjustment=None)

Bases: object

StepAdjustment specifies a step adjustment for the StepAdjustments property of the AWS::ApplicationAutoScaling::ScalingPolicy StepScalingPolicyConfiguration property type.

For the following examples, suppose that you have an alarm with a breach threshold of 50:

  • To trigger a step adjustment when the metric is greater than or equal to 50 and less than 60, specify a lower bound of 0 and an upper bound of 10.

  • To trigger a step adjustment when the metric is greater than 40 and less than or equal to 50, specify a lower bound of -10 and an upper bound of 0.

For more information, see Step adjustments in the Application Auto Scaling User Guide .

You can find a sample template snippet in the Examples section of the AWS::ApplicationAutoScaling::ScalingPolicy documentation.

Parameters:
  • metric_interval_lower_bound (Union[int, float, None]) – The lower bound for the difference between the alarm threshold and the CloudWatch metric. If the metric value is above the breach threshold, the lower bound is inclusive (the metric must be greater than or equal to the threshold plus the lower bound). Otherwise, it is exclusive (the metric must be greater than the threshold plus the lower bound). A null value indicates negative infinity. You must specify at least one upper or lower bound.

  • metric_interval_upper_bound (Union[int, float, None]) – The upper bound for the difference between the alarm threshold and the CloudWatch metric. If the metric value is above the breach threshold, the upper bound is exclusive (the metric must be less than the threshold plus the upper bound). Otherwise, it is inclusive (the metric must be less than or equal to the threshold plus the upper bound). A null value indicates positive infinity. You must specify at least one upper or lower bound.

  • scaling_adjustment (Union[int, float, None]) – The amount by which to scale. The adjustment is based on the value that you specified in the AdjustmentType property (either an absolute number or a percentage). A positive value adds to the current capacity and a negative number subtracts from the current capacity.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-stepadjustment.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_applicationautoscaling import mixins as applicationautoscaling_mixins

step_adjustment_property = applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.StepAdjustmentProperty(
    metric_interval_lower_bound=123,
    metric_interval_upper_bound=123,
    scaling_adjustment=123
)

Attributes

metric_interval_lower_bound

The lower bound for the difference between the alarm threshold and the CloudWatch metric.

If the metric value is above the breach threshold, the lower bound is inclusive (the metric must be greater than or equal to the threshold plus the lower bound). Otherwise, it is exclusive (the metric must be greater than the threshold plus the lower bound). A null value indicates negative infinity.

You must specify at least one upper or lower bound.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-stepadjustment.html#cfn-applicationautoscaling-scalingpolicy-stepadjustment-metricintervallowerbound

metric_interval_upper_bound

The upper bound for the difference between the alarm threshold and the CloudWatch metric.

If the metric value is above the breach threshold, the upper bound is exclusive (the metric must be less than the threshold plus the upper bound). Otherwise, it is inclusive (the metric must be less than or equal to the threshold plus the upper bound). A null value indicates positive infinity.

You must specify at least one upper or lower bound.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-stepadjustment.html#cfn-applicationautoscaling-scalingpolicy-stepadjustment-metricintervalupperbound

scaling_adjustment

The amount by which to scale.

The adjustment is based on the value that you specified in the AdjustmentType property (either an absolute number or a percentage). A positive value adds to the current capacity and a negative number subtracts from the current capacity.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-stepadjustment.html#cfn-applicationautoscaling-scalingpolicy-stepadjustment-scalingadjustment

StepScalingPolicyConfigurationProperty

class CfnScalingPolicyPropsMixin.StepScalingPolicyConfigurationProperty(*, adjustment_type=None, cooldown=None, metric_aggregation_type=None, min_adjustment_magnitude=None, step_adjustments=None)

Bases: object

StepScalingPolicyConfiguration is a property of the AWS::ApplicationAutoScaling::ScalingPolicy resource that specifies a step scaling policy configuration for Application Auto Scaling.

For more information, see Step scaling policies in the Application Auto Scaling User Guide .

Parameters:
  • adjustment_type (Optional[str]) – Specifies whether the ScalingAdjustment value in the StepAdjustment property is an absolute number or a percentage of the current capacity.

  • cooldown (Union[int, float, None]) – The amount of time, in seconds, to wait for a previous scaling activity to take effect. If not specified, the default value is 300. For more information, see Cooldown period in the Application Auto Scaling User Guide .

  • metric_aggregation_type (Optional[str]) – The aggregation type for the CloudWatch metrics. Valid values are Minimum , Maximum , and Average . If the aggregation type is null, the value is treated as Average .

  • min_adjustment_magnitude (Union[int, float, None]) – 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 Amazon ECS service by 25 percent and you specify a MinAdjustmentMagnitude of 2. If the service has 4 tasks and the scaling policy is performed, 25 percent of 4 is 1. However, because you specified a MinAdjustmentMagnitude of 2, Application Auto Scaling scales out the service by 2 tasks.

  • step_adjustments (Union[IResolvable, Sequence[Union[IResolvable, StepAdjustmentProperty, Dict[str, Any]]], None]) – A set of adjustments that enable you to scale based on the size of the alarm breach. At least one step adjustment is required if you are adding a new step scaling policy configuration.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-stepscalingpolicyconfiguration.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_applicationautoscaling import mixins as applicationautoscaling_mixins

step_scaling_policy_configuration_property = applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.StepScalingPolicyConfigurationProperty(
    adjustment_type="adjustmentType",
    cooldown=123,
    metric_aggregation_type="metricAggregationType",
    min_adjustment_magnitude=123,
    step_adjustments=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.StepAdjustmentProperty(
        metric_interval_lower_bound=123,
        metric_interval_upper_bound=123,
        scaling_adjustment=123
    )]
)

Attributes

adjustment_type

Specifies whether the ScalingAdjustment value in the StepAdjustment property is an absolute number or a percentage of the current capacity.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-stepscalingpolicyconfiguration.html#cfn-applicationautoscaling-scalingpolicy-stepscalingpolicyconfiguration-adjustmenttype

cooldown

The amount of time, in seconds, to wait for a previous scaling activity to take effect.

If not specified, the default value is 300. For more information, see Cooldown period in the Application Auto Scaling User Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-stepscalingpolicyconfiguration.html#cfn-applicationautoscaling-scalingpolicy-stepscalingpolicyconfiguration-cooldown

metric_aggregation_type

The aggregation type for the CloudWatch metrics.

Valid values are Minimum , Maximum , and Average . If the aggregation type is null, the value is treated as Average .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-stepscalingpolicyconfiguration.html#cfn-applicationautoscaling-scalingpolicy-stepscalingpolicyconfiguration-metricaggregationtype

min_adjustment_magnitude

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 Amazon ECS service by 25 percent and you specify a MinAdjustmentMagnitude of 2. If the service has 4 tasks and the scaling policy is performed, 25 percent of 4 is 1. However, because you specified a MinAdjustmentMagnitude of 2, Application Auto Scaling scales out the service by 2 tasks.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-stepscalingpolicyconfiguration.html#cfn-applicationautoscaling-scalingpolicy-stepscalingpolicyconfiguration-minadjustmentmagnitude

step_adjustments

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

At least one step adjustment is required if you are adding a new step scaling policy configuration.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-stepscalingpolicyconfiguration.html#cfn-applicationautoscaling-scalingpolicy-stepscalingpolicyconfiguration-stepadjustments

TargetTrackingMetricDataQueryProperty

class CfnScalingPolicyPropsMixin.TargetTrackingMetricDataQueryProperty(*, expression=None, id=None, label=None, metric_stat=None, return_data=None)

Bases: object

The metric data to return.

Also defines whether this call is returning data for one metric only, or whether it is performing a math expression on the values of returned metric statistics to create a new time series. A time series is a series of data points, each of which is associated with a timestamp.

You can call for a single metric or perform math expressions on multiple metrics. Any expressions used in a metric specification must eventually return a single time series.

For more information and examples, see Create a target tracking scaling policy for Application Auto Scaling using metric math in the Application Auto Scaling User Guide .

TargetTrackingMetricDataQuery is a property of the AWS::ApplicationAutoScaling::ScalingPolicy CustomizedMetricSpecification property type.

Parameters:
  • expression (Optional[str]) – The math expression to perform on the returned data, if this object is performing a math expression. This expression can use the Id of the other metrics to refer to those metrics, and can also use the Id of other expressions to use the result of those expressions. Conditional: Within each TargetTrackingMetricDataQuery object, you must specify either Expression or MetricStat , but not both.

  • id (Optional[str]) – A short name that identifies the object’s results in the response. This name must be unique among all MetricDataQuery objects specified for a single scaling policy. If you are performing math expressions on this set of data, this name represents that data and can serve as a variable in the mathematical expression. The valid characters are letters, numbers, and underscores. The first character must be a lowercase letter.

  • label (Optional[str]) – A human-readable label for this metric or expression. This is especially useful if this is a math expression, so that you know what the value represents.

  • metric_stat (Union[IResolvable, TargetTrackingMetricStatProperty, Dict[str, Any], None]) – Information about the metric data to return. Conditional: Within each MetricDataQuery object, you must specify either Expression or MetricStat , but not both.

  • return_data (Union[bool, IResolvable, None]) – Indicates whether to return the timestamps and raw data values of this metric. If you use any math expressions, specify true for this value for only the final math expression that the metric specification is based on. You must specify false for ReturnData for all the other metrics and expressions used in the metric specification. If you are only retrieving metrics and not performing any math expressions, do not specify anything for ReturnData . This sets it to its default ( true ).

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingmetricdataquery.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_applicationautoscaling import mixins as applicationautoscaling_mixins

target_tracking_metric_data_query_property = applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.TargetTrackingMetricDataQueryProperty(
    expression="expression",
    id="id",
    label="label",
    metric_stat=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.TargetTrackingMetricStatProperty(
        metric=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.TargetTrackingMetricProperty(
            dimensions=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.TargetTrackingMetricDimensionProperty(
                name="name",
                value="value"
            )],
            metric_name="metricName",
            namespace="namespace"
        ),
        stat="stat",
        unit="unit"
    ),
    return_data=False
)

Attributes

expression

The math expression to perform on the returned data, if this object is performing a math expression.

This expression can use the Id of the other metrics to refer to those metrics, and can also use the Id of other expressions to use the result of those expressions.

Conditional: Within each TargetTrackingMetricDataQuery object, you must specify either Expression or MetricStat , but not both.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingmetricdataquery.html#cfn-applicationautoscaling-scalingpolicy-targettrackingmetricdataquery-expression

id

A short name that identifies the object’s results in the response.

This name must be unique among all MetricDataQuery objects specified for a single scaling policy. If you are performing math expressions on this set of data, this name represents that data and can serve as a variable in the mathematical expression. The valid characters are letters, numbers, and underscores. The first character must be a lowercase letter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingmetricdataquery.html#cfn-applicationautoscaling-scalingpolicy-targettrackingmetricdataquery-id

label

A human-readable label for this metric or expression.

This is especially useful if this is a math expression, so that you know what the value represents.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingmetricdataquery.html#cfn-applicationautoscaling-scalingpolicy-targettrackingmetricdataquery-label

metric_stat

Information about the metric data to return.

Conditional: Within each MetricDataQuery object, you must specify either Expression or MetricStat , but not both.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingmetricdataquery.html#cfn-applicationautoscaling-scalingpolicy-targettrackingmetricdataquery-metricstat

return_data

Indicates whether to return the timestamps and raw data values of this metric.

If you use any math expressions, specify true for this value for only the final math expression that the metric specification is based on. You must specify false for ReturnData for all the other metrics and expressions used in the metric specification.

If you are only retrieving metrics and not performing any math expressions, do not specify anything for ReturnData . This sets it to its default ( true ).

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingmetricdataquery.html#cfn-applicationautoscaling-scalingpolicy-targettrackingmetricdataquery-returndata

TargetTrackingMetricDimensionProperty

class CfnScalingPolicyPropsMixin.TargetTrackingMetricDimensionProperty(*, name=None, value=None)

Bases: object

TargetTrackingMetricDimension specifies a name/value pair that is part of the identity of a CloudWatch metric for the Dimensions property of the AWS::ApplicationAutoScaling::ScalingPolicy TargetTrackingMetric property type. Duplicate dimensions are not allowed.

Parameters:
  • name (Optional[str]) – The name of the dimension.

  • value (Optional[str]) – The value of the dimension.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingmetricdimension.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_applicationautoscaling import mixins as applicationautoscaling_mixins

target_tracking_metric_dimension_property = applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.TargetTrackingMetricDimensionProperty(
    name="name",
    value="value"
)

Attributes

name

The name of the dimension.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingmetricdimension.html#cfn-applicationautoscaling-scalingpolicy-targettrackingmetricdimension-name

value

The value of the dimension.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingmetricdimension.html#cfn-applicationautoscaling-scalingpolicy-targettrackingmetricdimension-value

TargetTrackingMetricProperty

class CfnScalingPolicyPropsMixin.TargetTrackingMetricProperty(*, dimensions=None, metric_name=None, namespace=None)

Bases: object

Represents a specific metric for a target tracking scaling policy for Application Auto Scaling.

Metric is a property of the AWS::ApplicationAutoScaling::ScalingPolicy TargetTrackingMetricStat property type.

Parameters:
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingmetric.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_applicationautoscaling import mixins as applicationautoscaling_mixins

target_tracking_metric_property = applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.TargetTrackingMetricProperty(
    dimensions=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.TargetTrackingMetricDimensionProperty(
        name="name",
        value="value"
    )],
    metric_name="metricName",
    namespace="namespace"
)

Attributes

dimensions

The dimensions for the metric.

For the list of available dimensions, see the AWS documentation available from the table in AWS services that publish CloudWatch metrics in the Amazon CloudWatch User Guide .

Conditional: If you published your metric with dimensions, you must specify the same dimensions in your scaling policy.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingmetric.html#cfn-applicationautoscaling-scalingpolicy-targettrackingmetric-dimensions

metric_name

The name of the metric.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingmetric.html#cfn-applicationautoscaling-scalingpolicy-targettrackingmetric-metricname

namespace

The namespace of the metric.

For more information, see the table in AWS services that publish CloudWatch metrics in the Amazon CloudWatch User Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingmetric.html#cfn-applicationautoscaling-scalingpolicy-targettrackingmetric-namespace

TargetTrackingMetricStatProperty

class CfnScalingPolicyPropsMixin.TargetTrackingMetricStatProperty(*, metric=None, stat=None, unit=None)

Bases: object

This structure defines the CloudWatch metric to return, along with the statistic and unit.

TargetTrackingMetricStat is a property of the AWS::ApplicationAutoScaling::ScalingPolicy TargetTrackingMetricDataQuery property type.

For more information about the CloudWatch terminology below, see Amazon CloudWatch concepts in the Amazon CloudWatch User Guide .

Parameters:
  • metric (Union[IResolvable, TargetTrackingMetricProperty, Dict[str, Any], None]) –

    The CloudWatch metric to return, including the metric name, namespace, and dimensions. To get the exact metric name, namespace, and dimensions, inspect the Metric object that is returned by a call to ListMetrics .

  • stat (Optional[str]) –

    The statistic to return. It can include any CloudWatch statistic or extended statistic. For a list of valid values, see the table in Statistics in the Amazon CloudWatch User Guide . The most commonly used metric for scaling is Average .

  • unit (Optional[str]) –

    The unit to use for the returned data points. For a complete list of the units that CloudWatch supports, see the MetricDatum data type in the Amazon CloudWatch API Reference .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingmetricstat.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_applicationautoscaling import mixins as applicationautoscaling_mixins

target_tracking_metric_stat_property = applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.TargetTrackingMetricStatProperty(
    metric=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.TargetTrackingMetricProperty(
        dimensions=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.TargetTrackingMetricDimensionProperty(
            name="name",
            value="value"
        )],
        metric_name="metricName",
        namespace="namespace"
    ),
    stat="stat",
    unit="unit"
)

Attributes

metric

The CloudWatch metric to return, including the metric name, namespace, and dimensions.

To get the exact metric name, namespace, and dimensions, inspect the Metric object that is returned by a call to ListMetrics .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingmetricstat.html#cfn-applicationautoscaling-scalingpolicy-targettrackingmetricstat-metric

stat

The statistic to return.

It can include any CloudWatch statistic or extended statistic. For a list of valid values, see the table in Statistics in the Amazon CloudWatch User Guide .

The most commonly used metric for scaling is Average .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingmetricstat.html#cfn-applicationautoscaling-scalingpolicy-targettrackingmetricstat-stat

unit

The unit to use for the returned data points.

For a complete list of the units that CloudWatch supports, see the MetricDatum data type in the Amazon CloudWatch API Reference .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingmetricstat.html#cfn-applicationautoscaling-scalingpolicy-targettrackingmetricstat-unit

TargetTrackingScalingPolicyConfigurationProperty

class CfnScalingPolicyPropsMixin.TargetTrackingScalingPolicyConfigurationProperty(*, customized_metric_specification=None, disable_scale_in=None, predefined_metric_specification=None, scale_in_cooldown=None, scale_out_cooldown=None, target_value=None)

Bases: object

TargetTrackingScalingPolicyConfiguration is a property of the AWS::ApplicationAutoScaling::ScalingPolicy resource that specifies a target tracking scaling policy configuration for Application Auto Scaling. Use a target tracking scaling policy to adjust the capacity of the specified scalable target in response to actual workloads, so that resource utilization remains at or near the target utilization value.

For more information, see Target tracking scaling policies in the Application Auto Scaling User Guide .

Parameters:
  • customized_metric_specification (Union[IResolvable, CustomizedMetricSpecificationProperty, Dict[str, Any], None]) – A customized metric. You can specify either a predefined metric or a customized metric.

  • disable_scale_in (Union[bool, IResolvable, None]) – Indicates whether scale in by the target tracking scaling policy is disabled. If the value is true , scale in is disabled and the target tracking scaling policy won’t remove capacity from the scalable target. Otherwise, scale in is enabled and the target tracking scaling policy can remove capacity from the scalable target. The default value is false .

  • predefined_metric_specification (Union[IResolvable, PredefinedMetricSpecificationProperty, Dict[str, Any], None]) – A predefined metric. You can specify either a predefined metric or a customized metric.

  • scale_in_cooldown (Union[int, float, None]) – The amount of time, in seconds, after a scale-in activity completes before another scale-in activity can start. For more information and for default values, see Define cooldown periods in the Application Auto Scaling User Guide .

  • scale_out_cooldown (Union[int, float, None]) –

    The amount of time, in seconds, to wait for a previous scale-out activity to take effect. For more information and for default values, see Define cooldown periods in the Application Auto Scaling User Guide .

  • target_value (Union[int, float, None]) – The target value for the metric. Although this property accepts numbers of type Double, it won’t accept values that are either too small or too large. Values must be in the range of -2^360 to 2^360. The value must be a valid number based on the choice of metric. For example, if the metric is CPU utilization, then the target value is a percent value that represents how much of the CPU can be used before scaling out.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingscalingpolicyconfiguration.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_applicationautoscaling import mixins as applicationautoscaling_mixins

target_tracking_scaling_policy_configuration_property = applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.TargetTrackingScalingPolicyConfigurationProperty(
    customized_metric_specification=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.CustomizedMetricSpecificationProperty(
        dimensions=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.MetricDimensionProperty(
            name="name",
            value="value"
        )],
        metric_name="metricName",
        metrics=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.TargetTrackingMetricDataQueryProperty(
            expression="expression",
            id="id",
            label="label",
            metric_stat=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.TargetTrackingMetricStatProperty(
                metric=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.TargetTrackingMetricProperty(
                    dimensions=[applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.TargetTrackingMetricDimensionProperty(
                        name="name",
                        value="value"
                    )],
                    metric_name="metricName",
                    namespace="namespace"
                ),
                stat="stat",
                unit="unit"
            ),
            return_data=False
        )],
        namespace="namespace",
        statistic="statistic",
        unit="unit"
    ),
    disable_scale_in=False,
    predefined_metric_specification=applicationautoscaling_mixins.CfnScalingPolicyPropsMixin.PredefinedMetricSpecificationProperty(
        predefined_metric_type="predefinedMetricType",
        resource_label="resourceLabel"
    ),
    scale_in_cooldown=123,
    scale_out_cooldown=123,
    target_value=123
)

Attributes

customized_metric_specification

A customized metric.

You can specify either a predefined metric or a customized metric.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingscalingpolicyconfiguration.html#cfn-applicationautoscaling-scalingpolicy-targettrackingscalingpolicyconfiguration-customizedmetricspecification

disable_scale_in

Indicates whether scale in by the target tracking scaling policy is disabled.

If the value is true , scale in is disabled and the target tracking scaling policy won’t remove capacity from the scalable target. Otherwise, scale in is enabled and the target tracking scaling policy can remove capacity from the scalable target. The default value is false .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingscalingpolicyconfiguration.html#cfn-applicationautoscaling-scalingpolicy-targettrackingscalingpolicyconfiguration-disablescalein

predefined_metric_specification

A predefined metric.

You can specify either a predefined metric or a customized metric.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingscalingpolicyconfiguration.html#cfn-applicationautoscaling-scalingpolicy-targettrackingscalingpolicyconfiguration-predefinedmetricspecification

scale_in_cooldown

The amount of time, in seconds, after a scale-in activity completes before another scale-in activity can start.

For more information and for default values, see Define cooldown periods in the Application Auto Scaling User Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingscalingpolicyconfiguration.html#cfn-applicationautoscaling-scalingpolicy-targettrackingscalingpolicyconfiguration-scaleincooldown

scale_out_cooldown

The amount of time, in seconds, to wait for a previous scale-out activity to take effect.

For more information and for default values, see Define cooldown periods in the Application Auto Scaling User Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingscalingpolicyconfiguration.html#cfn-applicationautoscaling-scalingpolicy-targettrackingscalingpolicyconfiguration-scaleoutcooldown

target_value

The target value for the metric.

Although this property accepts numbers of type Double, it won’t accept values that are either too small or too large. Values must be in the range of -2^360 to 2^360. The value must be a valid number based on the choice of metric. For example, if the metric is CPU utilization, then the target value is a percent value that represents how much of the CPU can be used before scaling out.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalingpolicy-targettrackingscalingpolicyconfiguration.html#cfn-applicationautoscaling-scalingpolicy-targettrackingscalingpolicyconfiguration-targetvalue