CfnScalingPlan

class aws_cdk.aws_autoscalingplans.CfnScalingPlan(scope, id, *, application_source, scaling_instructions)

Bases: CfnResource

A CloudFormation AWS::AutoScalingPlans::ScalingPlan.

The AWS::AutoScalingPlans::ScalingPlan resource defines an AWS Auto Scaling scaling plan. A scaling plan is used to scale application resources to size them appropriately to ensure that enough resource is available in the application at peak times and to reduce allocated resource during periods of low utilization. The following resources can be added to a scaling plan:

  • Amazon EC2 Auto Scaling groups

  • Amazon EC2 Spot Fleet requests

  • Amazon ECS services

  • Amazon DynamoDB tables and global secondary indexes

  • Amazon Aurora Replicas

For more information, see the AWS Auto Scaling User Guide .

CloudformationResource:

AWS::AutoScalingPlans::ScalingPlan

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscalingplans-scalingplan.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscalingplans as autoscalingplans

cfn_scaling_plan = autoscalingplans.CfnScalingPlan(self, "MyCfnScalingPlan",
    application_source=autoscalingplans.CfnScalingPlan.ApplicationSourceProperty(
        cloud_formation_stack_arn="cloudFormationStackArn",
        tag_filters=[autoscalingplans.CfnScalingPlan.TagFilterProperty(
            key="key",

            # the properties below are optional
            values=["values"]
        )]
    ),
    scaling_instructions=[autoscalingplans.CfnScalingPlan.ScalingInstructionProperty(
        max_capacity=123,
        min_capacity=123,
        resource_id="resourceId",
        scalable_dimension="scalableDimension",
        service_namespace="serviceNamespace",
        target_tracking_configurations=[autoscalingplans.CfnScalingPlan.TargetTrackingConfigurationProperty(
            target_value=123,

            # the properties below are optional
            customized_scaling_metric_specification=autoscalingplans.CfnScalingPlan.CustomizedScalingMetricSpecificationProperty(
                metric_name="metricName",
                namespace="namespace",
                statistic="statistic",

                # the properties below are optional
                dimensions=[autoscalingplans.CfnScalingPlan.MetricDimensionProperty(
                    name="name",
                    value="value"
                )],
                unit="unit"
            ),
            disable_scale_in=False,
            estimated_instance_warmup=123,
            predefined_scaling_metric_specification=autoscalingplans.CfnScalingPlan.PredefinedScalingMetricSpecificationProperty(
                predefined_scaling_metric_type="predefinedScalingMetricType",

                # the properties below are optional
                resource_label="resourceLabel"
            ),
            scale_in_cooldown=123,
            scale_out_cooldown=123
        )],

        # the properties below are optional
        customized_load_metric_specification=autoscalingplans.CfnScalingPlan.CustomizedLoadMetricSpecificationProperty(
            metric_name="metricName",
            namespace="namespace",
            statistic="statistic",

            # the properties below are optional
            dimensions=[autoscalingplans.CfnScalingPlan.MetricDimensionProperty(
                name="name",
                value="value"
            )],
            unit="unit"
        ),
        disable_dynamic_scaling=False,
        predefined_load_metric_specification=autoscalingplans.CfnScalingPlan.PredefinedLoadMetricSpecificationProperty(
            predefined_load_metric_type="predefinedLoadMetricType",

            # the properties below are optional
            resource_label="resourceLabel"
        ),
        predictive_scaling_max_capacity_behavior="predictiveScalingMaxCapacityBehavior",
        predictive_scaling_max_capacity_buffer=123,
        predictive_scaling_mode="predictiveScalingMode",
        scaling_policy_update_behavior="scalingPolicyUpdateBehavior",
        scheduled_action_buffer_time=123
    )]
)

Create a new AWS::AutoScalingPlans::ScalingPlan.

Parameters:
  • scope (Construct) –

    • scope in which this resource is defined.

  • id (str) –

    • scoped id of the resource.

  • application_source (Union[ApplicationSourceProperty, Dict[str, Any], IResolvable]) – A CloudFormation stack or a set of tags. You can create one scaling plan per application source. The ApplicationSource property must be present to ensure interoperability with the AWS Auto Scaling console.

  • scaling_instructions (Union[IResolvable, Sequence[Union[IResolvable, ScalingInstructionProperty, Dict[str, Any]]]]) – The scaling instructions.

Methods

add_deletion_override(path)

Syntactic sugar for addOverride(path, undefined).

Parameters:

path (str) – The path of the value to delete.

Return type:

None

add_depends_on(target)

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

Parameters:

target (CfnResource) –

Return type:

None

add_metadata(key, value)

Add a value to the CloudFormation Resource Metadata.

Parameters:
  • key (str) –

  • value (Any) –

See:

Return type:

None

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

add_override(path, value)

Adds an override to the synthesized CloudFormation resource.

To add a property override, either use addPropertyOverride or prefix path with “Properties.” (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.

For example:

cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"])
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")

would add the overrides Example:

"Properties": {
   "GlobalSecondaryIndexes": [
     {
       "Projection": {
         "NonKeyAttributes": [ "myattribute" ]
         ...
       }
       ...
     },
     {
       "ProjectionType": "INCLUDE"
       ...
     },
   ]
   ...
}

The value argument to addOverride will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.

Parameters:
  • path (str) –

    • The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.

  • value (Any) –

    • The value. Could be primitive or complex.

Return type:

None

add_property_deletion_override(property_path)

Adds an override that deletes the value of a property from the resource definition.

Parameters:

property_path (str) – The path to the property.

Return type:

None

add_property_override(property_path, value)

Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).

Parameters:
  • property_path (str) – The path of the property.

  • value (Any) – The value.

Return type:

None

apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)

Sets the deletion policy of the resource based on the removal policy specified.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters:
  • policy (Optional[RemovalPolicy]) –

  • apply_to_update_replace_policy (Optional[bool]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: true

  • default (Optional[RemovalPolicy]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resoure, please consult that specific resource’s documentation.

Return type:

None

get_att(attribute_name)

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.

Parameters:

attribute_name (str) – The name of the attribute.

Return type:

Reference

get_metadata(key)

Retrieve a value value from the CloudFormation Resource Metadata.

Parameters:

key (str) –

See:

Return type:

Any

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

inspect(inspector)

Examines the CloudFormation resource and discloses attributes.

Parameters:

inspector (TreeInspector) –

  • tree inspector to collect and process attributes.

Return type:

None

override_logical_id(new_logical_id)

Overrides the auto-generated logical ID with a specific ID.

Parameters:

new_logical_id (str) – The new logical ID to use for this stack element.

Return type:

None

to_string()

Returns a string representation of this construct.

Return type:

str

Returns:

a string representation of this resource

Attributes

CFN_RESOURCE_TYPE_NAME = 'AWS::AutoScalingPlans::ScalingPlan'
application_source

A CloudFormation stack or a set of tags.

You can create one scaling plan per application source. The ApplicationSource property must be present to ensure interoperability with the AWS Auto Scaling console.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscalingplans-scalingplan.html#cfn-autoscalingplans-scalingplan-applicationsource

attr_scaling_plan_name

ScalingPlanName

Type:

cloudformationAttribute

attr_scaling_plan_version

ScalingPlanVersion

Type:

cloudformationAttribute

cfn_options

Options for this resource, such as condition, update policy etc.

cfn_resource_type

AWS resource type.

creation_stack

return:

the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.

logical_id

The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

Returns:

the logical ID as a stringified token. This value will only get resolved during synthesis.

node

The construct tree node associated with this construct.

ref

Return a string that will be resolved to a CloudFormation { Ref } for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).

scaling_instructions

The scaling instructions.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscalingplans-scalingplan.html#cfn-autoscalingplans-scalingplan-scalinginstructions

stack

The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

Static Methods

classmethod is_cfn_element(x)

Returns true if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.

Parameters:

x (Any) –

Return type:

bool

Returns:

The construct as a stack element or undefined if it is not a stack element.

classmethod is_cfn_resource(construct)

Check whether the given construct is a CfnResource.

Parameters:

construct (IConstruct) –

Return type:

bool

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters:

x (Any) –

Return type:

bool

ApplicationSourceProperty

class CfnScalingPlan.ApplicationSourceProperty(*, cloud_formation_stack_arn=None, tag_filters=None)

Bases: object

ApplicationSource is a property of ScalingPlan that specifies the application source to use with AWS Auto Scaling ( Auto Scaling Plans ). You can create one scaling plan per application source.

Parameters:
  • cloud_formation_stack_arn (Optional[str]) – The Amazon Resource Name (ARN) of a CloudFormation stack. You must specify either a CloudFormationStackARN or TagFilters .

  • tag_filters (Union[IResolvable, Sequence[Union[IResolvable, TagFilterProperty, Dict[str, Any]]], None]) – A set of tag filters (keys and values). Each tag filter specified must contain a key with values as optional. Each scaling plan can include up to 50 keys, and each key can include up to 20 values. Tags are part of the syntax that you use to specify the resources you want returned when configuring a scaling plan from the AWS Auto Scaling console. You do not need to specify valid tag filter values when you create a scaling plan with CloudFormation. The Key and Values properties can accept any value as long as the combination of values is unique across scaling plans. However, if you also want to use the AWS Auto Scaling console to edit the scaling plan, then you must specify valid values. You must specify either a CloudFormationStackARN or TagFilters .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-applicationsource.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscalingplans as autoscalingplans

application_source_property = autoscalingplans.CfnScalingPlan.ApplicationSourceProperty(
    cloud_formation_stack_arn="cloudFormationStackArn",
    tag_filters=[autoscalingplans.CfnScalingPlan.TagFilterProperty(
        key="key",

        # the properties below are optional
        values=["values"]
    )]
)

Attributes

cloud_formation_stack_arn

The Amazon Resource Name (ARN) of a CloudFormation stack.

You must specify either a CloudFormationStackARN or TagFilters .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-applicationsource.html#cfn-autoscalingplans-scalingplan-applicationsource-cloudformationstackarn

tag_filters

A set of tag filters (keys and values).

Each tag filter specified must contain a key with values as optional. Each scaling plan can include up to 50 keys, and each key can include up to 20 values.

Tags are part of the syntax that you use to specify the resources you want returned when configuring a scaling plan from the AWS Auto Scaling console. You do not need to specify valid tag filter values when you create a scaling plan with CloudFormation. The Key and Values properties can accept any value as long as the combination of values is unique across scaling plans. However, if you also want to use the AWS Auto Scaling console to edit the scaling plan, then you must specify valid values.

You must specify either a CloudFormationStackARN or TagFilters .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-applicationsource.html#cfn-autoscalingplans-scalingplan-applicationsource-tagfilters

CustomizedLoadMetricSpecificationProperty

class CfnScalingPlan.CustomizedLoadMetricSpecificationProperty(*, metric_name, namespace, statistic, dimensions=None, unit=None)

Bases: object

CustomizedLoadMetricSpecification is a subproperty of ScalingInstruction that specifies a customized load metric for predictive scaling to use with AWS Auto Scaling ( Auto Scaling Plans ).

For predictive scaling to work with a customized load metric specification, AWS Auto Scaling needs access to the Sum and Average statistics that CloudWatch computes from metric data.

When you choose a load metric, make sure that the required Sum and Average statistics for your metric are available in CloudWatch and that they provide relevant data for predictive scaling. The Sum statistic must represent the total load on the resource, and the Average statistic must represent the average load per capacity unit of the resource. For example, there is a metric that counts the number of requests processed by your Auto Scaling group. If the Sum statistic represents the total request count processed by the group, then the Average statistic for the specified metric must represent the average request count processed by each instance of the group.

If you publish your own metrics, you can aggregate the data points at a given interval and then publish the aggregated data points to CloudWatch. Before AWS Auto Scaling generates the forecast, it sums up all the metric data points that occurred within each hour to match the granularity period that is used in the forecast (60 minutes).

For information about terminology, available metrics, or how to publish new metrics, see Amazon CloudWatch Concepts in the Amazon CloudWatch User Guide .

After creating your scaling plan, you can use the AWS Auto Scaling console to visualize forecasts for the specified metric. For more information, see View Scaling Information for a Resource in the AWS Auto Scaling User Guide .

Parameters:
  • metric_name (str) – The name of the metric.

  • namespace (str) – The namespace of the metric.

  • statistic (str) – The statistic of the metric. Allowed Values : Sum

  • 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 customized load metric specification.

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

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-customizedloadmetricspecification.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscalingplans as autoscalingplans

customized_load_metric_specification_property = autoscalingplans.CfnScalingPlan.CustomizedLoadMetricSpecificationProperty(
    metric_name="metricName",
    namespace="namespace",
    statistic="statistic",

    # the properties below are optional
    dimensions=[autoscalingplans.CfnScalingPlan.MetricDimensionProperty(
        name="name",
        value="value"
    )],
    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 customized load metric specification.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-customizedloadmetricspecification.html#cfn-autoscalingplans-scalingplan-customizedloadmetricspecification-dimensions

metric_name

The name of the metric.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-customizedloadmetricspecification.html#cfn-autoscalingplans-scalingplan-customizedloadmetricspecification-metricname

namespace

The namespace of the metric.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-customizedloadmetricspecification.html#cfn-autoscalingplans-scalingplan-customizedloadmetricspecification-namespace

statistic

The statistic of the metric.

Allowed Values : Sum

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-customizedloadmetricspecification.html#cfn-autoscalingplans-scalingplan-customizedloadmetricspecification-statistic

unit

The unit of the metric.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-customizedloadmetricspecification.html#cfn-autoscalingplans-scalingplan-customizedloadmetricspecification-unit

CustomizedScalingMetricSpecificationProperty

class CfnScalingPlan.CustomizedScalingMetricSpecificationProperty(*, metric_name, namespace, statistic, dimensions=None, unit=None)

Bases: object

CustomizedScalingMetricSpecification is a subproperty of TargetTrackingConfiguration that specifies a customized scaling metric for a target tracking configuration to use with AWS Auto Scaling ( Auto Scaling Plans ).

To create your customized scaling metric specification:

  • Add values for each required property 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.

For information about terminology, available metrics, or how to publish new metrics, see Amazon CloudWatch Concepts in the Amazon CloudWatch User Guide .

Parameters:
  • metric_name (str) – The name of the metric. To get the exact metric name, namespace, and dimensions, inspect the Metrics object that is returned by a call to ListMetrics .

  • namespace (str) – The namespace of the metric.

  • statistic (str) – The statistic of the metric.

  • 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.

  • 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 .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-customizedscalingmetricspecification.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscalingplans as autoscalingplans

customized_scaling_metric_specification_property = autoscalingplans.CfnScalingPlan.CustomizedScalingMetricSpecificationProperty(
    metric_name="metricName",
    namespace="namespace",
    statistic="statistic",

    # the properties below are optional
    dimensions=[autoscalingplans.CfnScalingPlan.MetricDimensionProperty(
        name="name",
        value="value"
    )],
    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.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-customizedscalingmetricspecification.html#cfn-autoscalingplans-scalingplan-customizedscalingmetricspecification-dimensions

metric_name

The name of the metric.

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

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-customizedscalingmetricspecification.html#cfn-autoscalingplans-scalingplan-customizedscalingmetricspecification-metricname

namespace

The namespace of the metric.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-customizedscalingmetricspecification.html#cfn-autoscalingplans-scalingplan-customizedscalingmetricspecification-namespace

statistic

The statistic of the metric.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-customizedscalingmetricspecification.html#cfn-autoscalingplans-scalingplan-customizedscalingmetricspecification-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 .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-customizedscalingmetricspecification.html#cfn-autoscalingplans-scalingplan-customizedscalingmetricspecification-unit

MetricDimensionProperty

class CfnScalingPlan.MetricDimensionProperty(*, name, value)

Bases: object

MetricDimension is a subproperty of CustomizedScalingMetricSpecification that specifies a dimension for a customized metric to use with AWS Auto Scaling ( Auto Scaling Plans ). Dimensions are arbitrary name/value pairs that can be associated with a CloudWatch metric. Duplicate dimensions are not allowed.

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

  • value (str) – The value of the dimension.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-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.
import aws_cdk.aws_autoscalingplans as autoscalingplans

metric_dimension_property = autoscalingplans.CfnScalingPlan.MetricDimensionProperty(
    name="name",
    value="value"
)

Attributes

name

The name of the dimension.

Link:

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

value

The value of the dimension.

Link:

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

PredefinedLoadMetricSpecificationProperty

class CfnScalingPlan.PredefinedLoadMetricSpecificationProperty(*, predefined_load_metric_type, resource_label=None)

Bases: object

PredefinedLoadMetricSpecification is a subproperty of ScalingInstruction that specifies a predefined load metric for predictive scaling to use with AWS Auto Scaling ( Auto Scaling Plans ).

After creating your scaling plan, you can use the AWS Auto Scaling console to visualize forecasts for the specified metric. For more information, see View Scaling Information for a Resource in the AWS Auto Scaling User Guide .

Parameters:
  • predefined_load_metric_type (str) – The metric type.

  • resource_label (Optional[str]) – Identifies the resource associated with the metric type. You can’t specify a resource label unless the metric type is ALBTargetGroupRequestCount and there is a target group for an Application Load Balancer attached to the Auto Scaling group. 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 is app///targetgroup//, where: - app// is the final portion of the load balancer ARN - targetgroup// is the final portion of the target group ARN. This is an example: app/EC2Co-EcsEl-1TKLTMITMM0EO/f37c06a68c1748aa/targetgroup/EC2Co-Defau-LDNM7Q3ZH1ZN/6d4ea56ca2d6a18d. 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.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-predefinedloadmetricspecification.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscalingplans as autoscalingplans

predefined_load_metric_specification_property = autoscalingplans.CfnScalingPlan.PredefinedLoadMetricSpecificationProperty(
    predefined_load_metric_type="predefinedLoadMetricType",

    # the properties below are optional
    resource_label="resourceLabel"
)

Attributes

predefined_load_metric_type

The metric type.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-predefinedloadmetricspecification.html#cfn-autoscalingplans-scalingplan-predefinedloadmetricspecification-predefinedloadmetrictype

resource_label

Identifies the resource associated with the metric type.

You can’t specify a resource label unless the metric type is ALBTargetGroupRequestCount and there is a target group for an Application Load Balancer attached to the Auto Scaling group.

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 is app///targetgroup//, where:

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

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

This is an example: app/EC2Co-EcsEl-1TKLTMITMM0EO/f37c06a68c1748aa/targetgroup/EC2Co-Defau-LDNM7Q3ZH1ZN/6d4ea56ca2d6a18d.

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.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-predefinedloadmetricspecification.html#cfn-autoscalingplans-scalingplan-predefinedloadmetricspecification-resourcelabel

PredefinedScalingMetricSpecificationProperty

class CfnScalingPlan.PredefinedScalingMetricSpecificationProperty(*, predefined_scaling_metric_type, resource_label=None)

Bases: object

PredefinedScalingMetricSpecification is a subproperty of TargetTrackingConfiguration that specifies a customized scaling metric for a target tracking configuration to use with AWS Auto Scaling ( Auto Scaling Plans ).

Parameters:
  • predefined_scaling_metric_type (str) – The metric type. The ALBRequestCountPerTarget metric type applies only to Auto Scaling groups, 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 for an Application Load Balancer attached to the Auto Scaling group, Spot Fleet request, 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 is app///targetgroup//, where: - app// is the final portion of the load balancer ARN - targetgroup// is the final portion of the target group ARN. This is an example: app/EC2Co-EcsEl-1TKLTMITMM0EO/f37c06a68c1748aa/targetgroup/EC2Co-Defau-LDNM7Q3ZH1ZN/6d4ea56ca2d6a18d. 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.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-predefinedscalingmetricspecification.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscalingplans as autoscalingplans

predefined_scaling_metric_specification_property = autoscalingplans.CfnScalingPlan.PredefinedScalingMetricSpecificationProperty(
    predefined_scaling_metric_type="predefinedScalingMetricType",

    # the properties below are optional
    resource_label="resourceLabel"
)

Attributes

predefined_scaling_metric_type

The metric type.

The ALBRequestCountPerTarget metric type applies only to Auto Scaling groups, Spot Fleet requests, and ECS services.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-predefinedscalingmetricspecification.html#cfn-autoscalingplans-scalingplan-predefinedscalingmetricspecification-predefinedscalingmetrictype

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 for an Application Load Balancer attached to the Auto Scaling group, Spot Fleet request, 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 is app///targetgroup//, where:

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

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

This is an example: app/EC2Co-EcsEl-1TKLTMITMM0EO/f37c06a68c1748aa/targetgroup/EC2Co-Defau-LDNM7Q3ZH1ZN/6d4ea56ca2d6a18d.

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.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-predefinedscalingmetricspecification.html#cfn-autoscalingplans-scalingplan-predefinedscalingmetricspecification-resourcelabel

ScalingInstructionProperty

class CfnScalingPlan.ScalingInstructionProperty(*, max_capacity, min_capacity, resource_id, scalable_dimension, service_namespace, target_tracking_configurations, customized_load_metric_specification=None, disable_dynamic_scaling=None, predefined_load_metric_specification=None, predictive_scaling_max_capacity_behavior=None, predictive_scaling_max_capacity_buffer=None, predictive_scaling_mode=None, scaling_policy_update_behavior=None, scheduled_action_buffer_time=None)

Bases: object

ScalingInstruction is a property of ScalingPlan that specifies the scaling instruction for a scalable resource in a scaling plan. Each scaling instruction applies to one resource.

AWS Auto Scaling creates target tracking scaling policies based on the scaling instructions. Target tracking scaling policies adjust the capacity of your scalable resource as required to maintain resource utilization at the target value that you specified.

AWS Auto Scaling also configures predictive scaling for your Amazon EC2 Auto Scaling groups using a subset of properties, including the load metric, the scaling metric, the target value for the scaling metric, the predictive scaling mode (forecast and scale or forecast only), and the desired behavior when the forecast capacity exceeds the maximum capacity of the resource. With predictive scaling, AWS Auto Scaling generates forecasts with traffic predictions for the two days ahead and schedules scaling actions that proactively add and remove resource capacity to match the forecast. .. epigraph:

We recommend waiting a minimum of 24 hours after creating an Auto Scaling group to configure predictive scaling. At minimum, there must be 24 hours of historical data to generate a forecast. For more information, see `Best Practices for AWS Auto Scaling <https://docs.aws.amazon.com/autoscaling/plans/userguide/gs-best-practices.html>`_ in the *AWS Auto Scaling User Guide* .
Parameters:
  • max_capacity (Union[int, float]) – The maximum capacity of the resource. The exception to this upper limit is if you specify a non-default setting for PredictiveScalingMaxCapacityBehavior .

  • min_capacity (Union[int, float]) – The minimum capacity of the resource.

  • resource_id (str) – The ID of the resource. This string consists of the resource type and unique identifier. - Auto Scaling group - The resource type is autoScalingGroup and the unique identifier is the name of the Auto Scaling group. Example: autoScalingGroup/my-asg . - ECS service - The resource type is service and the unique identifier is the cluster name and service name. Example: service/default/sample-webapp . - Spot Fleet request - The resource type is spot-fleet-request and the unique identifier is the Spot Fleet request ID. Example: spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE . - DynamoDB table - The resource type is table and the unique identifier is the resource ID. Example: table/my-table . - DynamoDB global secondary index - The resource type is index and the unique identifier is the resource ID. Example: table/my-table/index/my-table-index . - Aurora DB cluster - The resource type is cluster and the unique identifier is the cluster name. Example: cluster:my-db-cluster .

  • scalable_dimension (str) – The scalable dimension associated with the resource. - autoscaling:autoScalingGroup:DesiredCapacity - The desired capacity of an Auto Scaling group. - ecs:service:DesiredCount - The desired task count of an ECS service. - ec2:spot-fleet-request:TargetCapacity - The target capacity of a Spot Fleet request. - dynamodb:table:ReadCapacityUnits - The provisioned read capacity for a DynamoDB table. - dynamodb:table:WriteCapacityUnits - The provisioned write capacity for a DynamoDB table. - dynamodb:index:ReadCapacityUnits - The provisioned read capacity for a DynamoDB global secondary index. - dynamodb:index:WriteCapacityUnits - The provisioned write capacity for a DynamoDB global secondary index. - rds:cluster:ReadReplicaCount - The count of Aurora Replicas in an Aurora DB cluster. Available for Aurora MySQL-compatible edition and Aurora PostgreSQL-compatible edition.

  • service_namespace (str) – The namespace of the AWS service.

  • target_tracking_configurations (Union[IResolvable, Sequence[Union[IResolvable, TargetTrackingConfigurationProperty, Dict[str, Any]]]]) – The target tracking configurations (up to 10). Each of these structures must specify a unique scaling metric and a target value for the metric.

  • customized_load_metric_specification (Union[IResolvable, CustomizedLoadMetricSpecificationProperty, Dict[str, Any], None]) – The customized load metric to use for predictive scaling. This property or a PredefinedLoadMetricSpecification is required when configuring predictive scaling, and cannot be used otherwise.

  • disable_dynamic_scaling (Union[bool, IResolvable, None]) – Controls whether dynamic scaling by AWS Auto Scaling is disabled. When dynamic scaling is enabled, AWS Auto Scaling creates target tracking scaling policies based on the specified target tracking configurations. The default is enabled ( false ).

  • predefined_load_metric_specification (Union[IResolvable, PredefinedLoadMetricSpecificationProperty, Dict[str, Any], None]) – The predefined load metric to use for predictive scaling. This property or a CustomizedLoadMetricSpecification is required when configuring predictive scaling, and cannot be used otherwise.

  • predictive_scaling_max_capacity_behavior (Optional[str]) – Defines the behavior that should be applied if the forecast capacity approaches or exceeds the maximum capacity specified for the resource. The default value is SetForecastCapacityToMaxCapacity . The following are possible values: - SetForecastCapacityToMaxCapacity - AWS Auto Scaling cannot scale resource capacity higher than the maximum capacity. The maximum capacity is enforced as a hard limit. - SetMaxCapacityToForecastCapacity - AWS Auto Scaling can scale resource capacity higher than the maximum capacity to equal but not exceed forecast capacity. - SetMaxCapacityAboveForecastCapacity - AWS Auto Scaling can scale resource capacity higher than the maximum capacity by a specified buffer value. The intention is to give the target tracking scaling policy extra capacity if unexpected traffic occurs. Valid only when configuring predictive scaling.

  • predictive_scaling_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. With a 10 percent buffer, if the forecast capacity is 50, and the maximum capacity is 40, then the effective maximum capacity is 55. Valid only when configuring predictive scaling. Required if PredictiveScalingMaxCapacityBehavior is set to SetMaxCapacityAboveForecastCapacity , and cannot be used otherwise. The range is 1-100.

  • predictive_scaling_mode (Optional[str]) – The predictive scaling mode. The default value is ForecastAndScale . Otherwise, AWS Auto Scaling forecasts capacity but does not apply any scheduled scaling actions based on the capacity forecast.

  • scaling_policy_update_behavior (Optional[str]) – Controls whether your scaling policies that are external to AWS Auto Scaling are deleted and new target tracking scaling policies created. The default value is KeepExternalPolicies . Valid only when configuring dynamic scaling.

  • scheduled_action_buffer_time (Union[int, float, None]) – The amount of time, in seconds, to buffer the run time of scheduled scaling actions when scaling out. For example, if the forecast says to add capacity at 10:00 AM, and the buffer time is 5 minutes, then the run time of the corresponding scheduled scaling action will be 9:55 AM. The intention is to give resources time to be provisioned. For example, it can take a few minutes to launch an EC2 instance. The actual amount of time required depends on several factors, such as the size of the instance and whether there are startup scripts to complete. The value must be less than the forecast interval duration of 3600 seconds (60 minutes). The default is 300 seconds. Valid only when configuring predictive scaling.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-scalinginstruction.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscalingplans as autoscalingplans

scaling_instruction_property = autoscalingplans.CfnScalingPlan.ScalingInstructionProperty(
    max_capacity=123,
    min_capacity=123,
    resource_id="resourceId",
    scalable_dimension="scalableDimension",
    service_namespace="serviceNamespace",
    target_tracking_configurations=[autoscalingplans.CfnScalingPlan.TargetTrackingConfigurationProperty(
        target_value=123,

        # the properties below are optional
        customized_scaling_metric_specification=autoscalingplans.CfnScalingPlan.CustomizedScalingMetricSpecificationProperty(
            metric_name="metricName",
            namespace="namespace",
            statistic="statistic",

            # the properties below are optional
            dimensions=[autoscalingplans.CfnScalingPlan.MetricDimensionProperty(
                name="name",
                value="value"
            )],
            unit="unit"
        ),
        disable_scale_in=False,
        estimated_instance_warmup=123,
        predefined_scaling_metric_specification=autoscalingplans.CfnScalingPlan.PredefinedScalingMetricSpecificationProperty(
            predefined_scaling_metric_type="predefinedScalingMetricType",

            # the properties below are optional
            resource_label="resourceLabel"
        ),
        scale_in_cooldown=123,
        scale_out_cooldown=123
    )],

    # the properties below are optional
    customized_load_metric_specification=autoscalingplans.CfnScalingPlan.CustomizedLoadMetricSpecificationProperty(
        metric_name="metricName",
        namespace="namespace",
        statistic="statistic",

        # the properties below are optional
        dimensions=[autoscalingplans.CfnScalingPlan.MetricDimensionProperty(
            name="name",
            value="value"
        )],
        unit="unit"
    ),
    disable_dynamic_scaling=False,
    predefined_load_metric_specification=autoscalingplans.CfnScalingPlan.PredefinedLoadMetricSpecificationProperty(
        predefined_load_metric_type="predefinedLoadMetricType",

        # the properties below are optional
        resource_label="resourceLabel"
    ),
    predictive_scaling_max_capacity_behavior="predictiveScalingMaxCapacityBehavior",
    predictive_scaling_max_capacity_buffer=123,
    predictive_scaling_mode="predictiveScalingMode",
    scaling_policy_update_behavior="scalingPolicyUpdateBehavior",
    scheduled_action_buffer_time=123
)

Attributes

customized_load_metric_specification

The customized load metric to use for predictive scaling.

This property or a PredefinedLoadMetricSpecification is required when configuring predictive scaling, and cannot be used otherwise.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-scalinginstruction.html#cfn-autoscalingplans-scalingplan-scalinginstruction-customizedloadmetricspecification

disable_dynamic_scaling

Controls whether dynamic scaling by AWS Auto Scaling is disabled.

When dynamic scaling is enabled, AWS Auto Scaling creates target tracking scaling policies based on the specified target tracking configurations.

The default is enabled ( false ).

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-scalinginstruction.html#cfn-autoscalingplans-scalingplan-scalinginstruction-disabledynamicscaling

max_capacity

The maximum capacity of the resource.

The exception to this upper limit is if you specify a non-default setting for PredictiveScalingMaxCapacityBehavior .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-scalinginstruction.html#cfn-autoscalingplans-scalingplan-scalinginstruction-maxcapacity

min_capacity

The minimum capacity of the resource.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-scalinginstruction.html#cfn-autoscalingplans-scalingplan-scalinginstruction-mincapacity

predefined_load_metric_specification

The predefined load metric to use for predictive scaling.

This property or a CustomizedLoadMetricSpecification is required when configuring predictive scaling, and cannot be used otherwise.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-scalinginstruction.html#cfn-autoscalingplans-scalingplan-scalinginstruction-predefinedloadmetricspecification

predictive_scaling_max_capacity_behavior

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

The default value is SetForecastCapacityToMaxCapacity .

The following are possible values:

  • SetForecastCapacityToMaxCapacity - AWS Auto Scaling cannot scale resource capacity higher than the maximum capacity. The maximum capacity is enforced as a hard limit.

  • SetMaxCapacityToForecastCapacity - AWS Auto Scaling can scale resource capacity higher than the maximum capacity to equal but not exceed forecast capacity.

  • SetMaxCapacityAboveForecastCapacity - AWS Auto Scaling can scale resource capacity higher than the maximum capacity by a specified buffer value. The intention is to give the target tracking scaling policy extra capacity if unexpected traffic occurs.

Valid only when configuring predictive scaling.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-scalinginstruction.html#cfn-autoscalingplans-scalingplan-scalinginstruction-predictivescalingmaxcapacitybehavior

predictive_scaling_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. With a 10 percent buffer, if the forecast capacity is 50, and the maximum capacity is 40, then the effective maximum capacity is 55.

Valid only when configuring predictive scaling. Required if PredictiveScalingMaxCapacityBehavior is set to SetMaxCapacityAboveForecastCapacity , and cannot be used otherwise.

The range is 1-100.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-scalinginstruction.html#cfn-autoscalingplans-scalingplan-scalinginstruction-predictivescalingmaxcapacitybuffer

predictive_scaling_mode

The predictive scaling mode.

The default value is ForecastAndScale . Otherwise, AWS Auto Scaling forecasts capacity but does not apply any scheduled scaling actions based on the capacity forecast.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-scalinginstruction.html#cfn-autoscalingplans-scalingplan-scalinginstruction-predictivescalingmode

resource_id

The ID of the resource. This string consists of the resource type and unique identifier.

  • Auto Scaling group - The resource type is autoScalingGroup and the unique identifier is the name of the Auto Scaling group. Example: autoScalingGroup/my-asg .

  • ECS service - The resource type is service and the unique identifier is the cluster name and service name. Example: service/default/sample-webapp .

  • Spot Fleet request - The resource type is spot-fleet-request and the unique identifier is the Spot Fleet request ID. Example: spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE .

  • DynamoDB table - The resource type is table and the unique identifier is the resource ID. Example: table/my-table .

  • DynamoDB global secondary index - The resource type is index and the unique identifier is the resource ID. Example: table/my-table/index/my-table-index .

  • Aurora DB cluster - The resource type is cluster and the unique identifier is the cluster name. Example: cluster:my-db-cluster .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-scalinginstruction.html#cfn-autoscalingplans-scalingplan-scalinginstruction-resourceid

scalable_dimension

The scalable dimension associated with the resource.

  • autoscaling:autoScalingGroup:DesiredCapacity - The desired capacity of an Auto Scaling group.

  • ecs:service:DesiredCount - The desired task count of an ECS service.

  • ec2:spot-fleet-request:TargetCapacity - The target capacity of a Spot Fleet request.

  • dynamodb:table:ReadCapacityUnits - The provisioned read capacity for a DynamoDB table.

  • dynamodb:table:WriteCapacityUnits - The provisioned write capacity for a DynamoDB table.

  • dynamodb:index:ReadCapacityUnits - The provisioned read capacity for a DynamoDB global secondary index.

  • dynamodb:index:WriteCapacityUnits - The provisioned write capacity for a DynamoDB global secondary index.

  • rds:cluster:ReadReplicaCount - The count of Aurora Replicas in an Aurora DB cluster. Available for Aurora MySQL-compatible edition and Aurora PostgreSQL-compatible edition.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-scalinginstruction.html#cfn-autoscalingplans-scalingplan-scalinginstruction-scalabledimension

scaling_policy_update_behavior

Controls whether your scaling policies that are external to AWS Auto Scaling are deleted and new target tracking scaling policies created.

The default value is KeepExternalPolicies .

Valid only when configuring dynamic scaling.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-scalinginstruction.html#cfn-autoscalingplans-scalingplan-scalinginstruction-scalingpolicyupdatebehavior

scheduled_action_buffer_time

The amount of time, in seconds, to buffer the run time of scheduled scaling actions when scaling out.

For example, if the forecast says to add capacity at 10:00 AM, and the buffer time is 5 minutes, then the run time of the corresponding scheduled scaling action will be 9:55 AM. The intention is to give resources time to be provisioned. For example, it can take a few minutes to launch an EC2 instance. The actual amount of time required depends on several factors, such as the size of the instance and whether there are startup scripts to complete.

The value must be less than the forecast interval duration of 3600 seconds (60 minutes). The default is 300 seconds.

Valid only when configuring predictive scaling.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-scalinginstruction.html#cfn-autoscalingplans-scalingplan-scalinginstruction-scheduledactionbuffertime

service_namespace

The namespace of the AWS service.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-scalinginstruction.html#cfn-autoscalingplans-scalingplan-scalinginstruction-servicenamespace

target_tracking_configurations

The target tracking configurations (up to 10).

Each of these structures must specify a unique scaling metric and a target value for the metric.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-scalinginstruction.html#cfn-autoscalingplans-scalingplan-scalinginstruction-targettrackingconfigurations

TagFilterProperty

class CfnScalingPlan.TagFilterProperty(*, key, values=None)

Bases: object

TagFilter is a subproperty of ApplicationSource that specifies a tag for an application source to use with AWS Auto Scaling ( Auto Scaling Plans ).

Parameters:
  • key (str) – The tag key.

  • values (Optional[Sequence[str]]) – The tag values (0 to 20).

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-tagfilter.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscalingplans as autoscalingplans

tag_filter_property = autoscalingplans.CfnScalingPlan.TagFilterProperty(
    key="key",

    # the properties below are optional
    values=["values"]
)

Attributes

key

The tag key.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-tagfilter.html#cfn-autoscalingplans-scalingplan-tagfilter-key

values

The tag values (0 to 20).

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-tagfilter.html#cfn-autoscalingplans-scalingplan-tagfilter-values

TargetTrackingConfigurationProperty

class CfnScalingPlan.TargetTrackingConfigurationProperty(*, target_value, customized_scaling_metric_specification=None, disable_scale_in=None, estimated_instance_warmup=None, predefined_scaling_metric_specification=None, scale_in_cooldown=None, scale_out_cooldown=None)

Bases: object

TargetTrackingConfiguration is a subproperty of ScalingInstruction that specifies a target tracking configuration to use with AWS Auto Scaling ( Auto Scaling Plans ).

Parameters:
  • target_value (Union[int, float]) – 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.

  • customized_scaling_metric_specification (Union[IResolvable, CustomizedScalingMetricSpecificationProperty, 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 doesn’t remove capacity from the scalable resource. Otherwise, scale in is enabled and the target tracking scaling policy can remove capacity from the scalable resource. The default value is false .

  • estimated_instance_warmup (Union[int, float, None]) – The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. This value is used only if the resource is an Auto Scaling group.

  • predefined_scaling_metric_specification (Union[IResolvable, PredefinedScalingMetricSpecificationProperty, 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. This value is not used if the scalable resource is an Auto Scaling group.

  • scale_out_cooldown (Union[int, float, None]) – The amount of time, in seconds, after a scale-out activity completes before another scale-out activity can start. This value is not used if the scalable resource is an Auto Scaling group.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-targettrackingconfiguration.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscalingplans as autoscalingplans

target_tracking_configuration_property = autoscalingplans.CfnScalingPlan.TargetTrackingConfigurationProperty(
    target_value=123,

    # the properties below are optional
    customized_scaling_metric_specification=autoscalingplans.CfnScalingPlan.CustomizedScalingMetricSpecificationProperty(
        metric_name="metricName",
        namespace="namespace",
        statistic="statistic",

        # the properties below are optional
        dimensions=[autoscalingplans.CfnScalingPlan.MetricDimensionProperty(
            name="name",
            value="value"
        )],
        unit="unit"
    ),
    disable_scale_in=False,
    estimated_instance_warmup=123,
    predefined_scaling_metric_specification=autoscalingplans.CfnScalingPlan.PredefinedScalingMetricSpecificationProperty(
        predefined_scaling_metric_type="predefinedScalingMetricType",

        # the properties below are optional
        resource_label="resourceLabel"
    ),
    scale_in_cooldown=123,
    scale_out_cooldown=123
)

Attributes

customized_scaling_metric_specification

A customized metric.

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

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-targettrackingconfiguration.html#cfn-autoscalingplans-scalingplan-targettrackingconfiguration-customizedscalingmetricspecification

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 doesn’t remove capacity from the scalable resource. Otherwise, scale in is enabled and the target tracking scaling policy can remove capacity from the scalable resource.

The default value is false .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-targettrackingconfiguration.html#cfn-autoscalingplans-scalingplan-targettrackingconfiguration-disablescalein

estimated_instance_warmup

The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics.

This value is used only if the resource is an Auto Scaling group.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-targettrackingconfiguration.html#cfn-autoscalingplans-scalingplan-targettrackingconfiguration-estimatedinstancewarmup

predefined_scaling_metric_specification

A predefined metric.

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

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-targettrackingconfiguration.html#cfn-autoscalingplans-scalingplan-targettrackingconfiguration-predefinedscalingmetricspecification

scale_in_cooldown

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

This value is not used if the scalable resource is an Auto Scaling group.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-targettrackingconfiguration.html#cfn-autoscalingplans-scalingplan-targettrackingconfiguration-scaleincooldown

scale_out_cooldown

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

This value is not used if the scalable resource is an Auto Scaling group.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-targettrackingconfiguration.html#cfn-autoscalingplans-scalingplan-targettrackingconfiguration-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.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-targettrackingconfiguration.html#cfn-autoscalingplans-scalingplan-targettrackingconfiguration-targetvalue