CfnScalingPolicyPropsMixin
- class aws_cdk.mixins_preview.aws_applicationautoscaling.mixins.CfnScalingPolicyPropsMixin(props, *, strategy=None)
Bases:
MixinThe
AWS::ApplicationAutoScaling::ScalingPolicyresource 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:
- 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:
props (
Union[CfnScalingPolicyMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
- 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
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
CustomizedMetricSpecificationProperty
- class CfnScalingPolicyPropsMixin.CustomizedMetricSpecificationProperty(*, dimensions=None, metric_name=None, metrics=None, namespace=None, statistic=None, unit=None)
Bases:
objectContains 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 .
CustomizedMetricSpecificationis 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:
- 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.
- 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 .
- 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.
- namespace
The namespace of the metric.
- statistic
The statistic of the metric.
- 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 .
MetricDimensionProperty
- class CfnScalingPolicyPropsMixin.MetricDimensionProperty(*, name=None, value=None)
Bases:
objectMetricDimensionspecifies a name/value pair that is part of the identity of a CloudWatch metric for theDimensionsproperty 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:
- 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.
PredefinedMetricSpecificationProperty
- class CfnScalingPolicyPropsMixin.PredefinedMetricSpecificationProperty(*, predefined_metric_type=None, resource_label=None)
Bases:
objectContains predefined metric specification information for a target tracking scaling policy for Application Auto Scaling.
PredefinedMetricSpecificationis a property of the AWS::ApplicationAutoScaling::ScalingPolicy TargetTrackingScalingPolicyConfiguration property type.- Parameters:
predefined_metric_type (
Optional[str]) – The metric type. TheALBRequestCountPerTargetmetric 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 isALBRequestCountPerTargetand 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:
- 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
ALBRequestCountPerTargetmetric type applies only to Spot fleet requests and ECS services.
- resource_label
Identifies the resource associated with the metric type.
You can’t specify a resource label unless the metric type is
ALBRequestCountPerTargetand 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.
PredictiveScalingCustomizedCapacityMetricProperty
- class CfnScalingPolicyPropsMixin.PredictiveScalingCustomizedCapacityMetricProperty(*, metric_data_queries=None)
Bases:
objectRepresents 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:
- 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.
PredictiveScalingCustomizedLoadMetricProperty
- class CfnScalingPolicyPropsMixin.PredictiveScalingCustomizedLoadMetricProperty(*, metric_data_queries=None)
Bases:
objectThe customized load metric specification.
- Parameters:
metric_data_queries (
Union[IResolvable,Sequence[Union[IResolvable,PredictiveScalingMetricDataQueryProperty,Dict[str,Any]]],None])- See:
- 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
PredictiveScalingCustomizedScalingMetricProperty
- class CfnScalingPolicyPropsMixin.PredictiveScalingCustomizedScalingMetricProperty(*, metric_data_queries=None)
Bases:
objectOne 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:
- 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.
PredictiveScalingMetricDataQueryProperty
- class CfnScalingPolicyPropsMixin.PredictiveScalingMetricDataQueryProperty(*, expression=None, id=None, label=None, metric_stat=None, return_data=None)
Bases:
objectThe 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 theIdof the other metrics to refer to those metrics, and can also use theIdof other expressions to use the result of those expressions. Conditional: Within eachMetricDataQueryobject, you must specify eitherExpressionorMetricStat, but not both.id (
Optional[str]) – A short name that identifies the object’s results in the response. This name must be unique among allMetricDataQueryobjects 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 eachMetricDataQueryobject, you must specify eitherExpressionorMetricStat, 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, specifytruefor this value for only the final math expression that the metric specification is based on. You must specifyfalseforReturnDatafor 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 forReturnData. This sets it to its default (true).
- See:
- 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
Idof the other metrics to refer to those metrics, and can also use theIdof other expressions to use the result of those expressions.Conditional: Within each
MetricDataQueryobject, you must specify eitherExpressionorMetricStat, but not both.
- id
A short name that identifies the object’s results in the response.
This name must be unique among all
MetricDataQueryobjects 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
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
Information about the metric data to return.
Conditional: Within each
MetricDataQueryobject, you must specify eitherExpressionorMetricStat, but not both.
- return_data
Indicates whether to return the timestamps and raw data values of this metric.
If you use any math expressions, specify
truefor this value for only the final math expression that the metric specification is based on. You must specifyfalseforReturnDatafor 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).
PredictiveScalingMetricDimensionProperty
- class CfnScalingPolicyPropsMixin.PredictiveScalingMetricDimensionProperty(*, name=None, value=None)
Bases:
objectDescribes the dimension of a metric.
- Parameters:
name (
Optional[str]) – The name of the dimension.value (
Optional[str]) – The value of the dimension.
- See:
- 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.
PredictiveScalingMetricProperty
- class CfnScalingPolicyPropsMixin.PredictiveScalingMetricProperty(*, dimensions=None, metric_name=None, namespace=None)
Bases:
objectDescribes the scaling metric.
- Parameters:
dimensions (
Union[IResolvable,Sequence[Union[IResolvable,PredictiveScalingMetricDimensionProperty,Dict[str,Any]]],None]) – Describes the dimensions of the metric.metric_name (
Optional[str]) – The name of the metric.namespace (
Optional[str]) – The namespace of the metric.
- See:
- 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.
- metric_name
The name of the metric.
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:
objectThis 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:
customized_capacity_metric_specification (
Union[IResolvable,PredictiveScalingCustomizedCapacityMetricProperty,Dict[str,Any],None]) – The customized capacity metric specification.customized_load_metric_specification (
Union[IResolvable,PredictiveScalingCustomizedLoadMetricProperty,Dict[str,Any],None]) – The customized load metric specification.customized_scaling_metric_specification (
Union[IResolvable,PredictiveScalingCustomizedScalingMetricProperty,Dict[str,Any],None]) – The customized scaling metric specification.predefined_load_metric_specification (
Union[IResolvable,PredictiveScalingPredefinedLoadMetricProperty,Dict[str,Any],None]) – The predefined load metric specification.predefined_metric_pair_specification (
Union[IResolvable,PredictiveScalingPredefinedMetricPairProperty,Dict[str,Any],None]) – The predefined metric pair specification that determines the appropriate scaling metric and load metric to use.predefined_scaling_metric_specification (
Union[IResolvable,PredictiveScalingPredefinedScalingMetricProperty,Dict[str,Any],None]) – The predefined scaling metric specification.target_value (
Union[int,float,None]) – Specifies the target utilization.
- See:
- 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.
- customized_load_metric_specification
The customized load metric specification.
- customized_scaling_metric_specification
The customized scaling metric specification.
- predefined_load_metric_specification
The predefined load metric specification.
- predefined_metric_pair_specification
The predefined metric pair specification that determines the appropriate scaling metric and load metric to use.
- predefined_scaling_metric_specification
The predefined scaling metric specification.
PredictiveScalingMetricStatProperty
- class CfnScalingPolicyPropsMixin.PredictiveScalingMetricStatProperty(*, metric=None, stat=None, unit=None)
Bases:
objectThis 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 areAverageandSum.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:
- 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 .
- 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
AverageandSum.
- 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 .
PredictiveScalingPolicyConfigurationProperty
- class CfnScalingPolicyPropsMixin.PredictiveScalingPolicyConfigurationProperty(*, max_capacity_breach_behavior=None, max_capacity_buffer=None, metric_specifications=None, mode=None, scheduling_buffer_time=None)
Bases:
objectRepresents 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 toHonorMaxCapacityif 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 theMaxCapacityBreachBehaviorproperty is set toIncreaseMaxCapacity, 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 toForecastOnlyif 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:
- 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
HonorMaxCapacityif not specified.
- 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
MaxCapacityBreachBehaviorproperty is set toIncreaseMaxCapacity, and cannot be used otherwise.
- 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.
- mode
The predictive scaling mode.
Defaults to
ForecastOnlyif not specified.
- 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.
PredictiveScalingPredefinedLoadMetricProperty
- class CfnScalingPolicyPropsMixin.PredictiveScalingPredefinedLoadMetricProperty(*, predefined_metric_type=None, resource_label=None)
Bases:
objectDescribes 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:
ECSServiceAverageCPUUtilizationECSServiceAverageMemoryUtilizationECSServiceCPUUtilizationECSServiceMemoryUtilizationECSServiceTotalCPUUtilizationECSServiceTotalMemoryUtilizationALBRequestCountALBRequestCountPerTargetTotalALBRequestCount
- Parameters:
predefined_metric_type (
Optional[str]) – The metric type.resource_label (
Optional[str]) – A label that uniquely identifies a target group.
- See:
- 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.
- resource_label
A label that uniquely identifies a target group.
PredictiveScalingPredefinedMetricPairProperty
- class CfnScalingPolicyPropsMixin.PredictiveScalingPredefinedMetricPairProperty(*, predefined_metric_type=None, resource_label=None)
Bases:
objectRepresents a metric pair for a predictive scaling policy.
The following predefined metrics are available for predictive scaling:
ECSServiceAverageCPUUtilizationECSServiceAverageMemoryUtilizationECSServiceCPUUtilizationECSServiceMemoryUtilizationECSServiceTotalCPUUtilizationECSServiceTotalMemoryUtilizationALBRequestCountALBRequestCountPerTargetTotalALBRequestCount
- 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:
- 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.
- resource_label
A label that uniquely identifies a specific target group from which to determine the total and average request count.
PredictiveScalingPredefinedScalingMetricProperty
- class CfnScalingPolicyPropsMixin.PredictiveScalingPredefinedScalingMetricProperty(*, predefined_metric_type=None, resource_label=None)
Bases:
objectDescribes 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:
ECSServiceAverageCPUUtilizationECSServiceAverageMemoryUtilizationECSServiceCPUUtilizationECSServiceMemoryUtilizationECSServiceTotalCPUUtilizationECSServiceTotalMemoryUtilizationALBRequestCountALBRequestCountPerTargetTotalALBRequestCount
- 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:
- 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.
- resource_label
A label that uniquely identifies a specific target group from which to determine the average request count.
StepAdjustmentProperty
- class CfnScalingPolicyPropsMixin.StepAdjustmentProperty(*, metric_interval_lower_bound=None, metric_interval_upper_bound=None, scaling_adjustment=None)
Bases:
objectStepAdjustmentspecifies a step adjustment for theStepAdjustmentsproperty 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::ScalingPolicydocumentation.- 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 theAdjustmentTypeproperty (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:
- 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.
- 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.
- scaling_adjustment
The amount by which to scale.
The adjustment is based on the value that you specified in the
AdjustmentTypeproperty (either an absolute number or a percentage). A positive value adds to the current capacity and a negative number subtracts from the current capacity.
StepScalingPolicyConfigurationProperty
- class CfnScalingPolicyPropsMixin.StepScalingPolicyConfigurationProperty(*, adjustment_type=None, cooldown=None, metric_aggregation_type=None, min_adjustment_magnitude=None, step_adjustments=None)
Bases:
objectStepScalingPolicyConfigurationis 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 theScalingAdjustmentvalue in theStepAdjustmentproperty 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 areMinimum,Maximum, andAverage. If the aggregation type is null, the value is treated asAverage.min_adjustment_magnitude (
Union[int,float,None]) – The minimum value to scale by when the adjustment type isPercentChangeInCapacity. For example, suppose that you create a step scaling policy to scale out an Amazon ECS service by 25 percent and you specify aMinAdjustmentMagnitudeof 2. If the service has 4 tasks and the scaling policy is performed, 25 percent of 4 is 1. However, because you specified aMinAdjustmentMagnitudeof 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:
- 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
ScalingAdjustmentvalue in theStepAdjustmentproperty is an absolute number or a percentage of the current capacity.
- 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 .
- metric_aggregation_type
The aggregation type for the CloudWatch metrics.
Valid values are
Minimum,Maximum, andAverage. If the aggregation type is null, the value is treated asAverage.
- 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
MinAdjustmentMagnitudeof 2. If the service has 4 tasks and the scaling policy is performed, 25 percent of 4 is 1. However, because you specified aMinAdjustmentMagnitudeof 2, Application Auto Scaling scales out the service by 2 tasks.
- 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.
TargetTrackingMetricDataQueryProperty
- class CfnScalingPolicyPropsMixin.TargetTrackingMetricDataQueryProperty(*, expression=None, id=None, label=None, metric_stat=None, return_data=None)
Bases:
objectThe 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 .
TargetTrackingMetricDataQueryis 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 theIdof the other metrics to refer to those metrics, and can also use theIdof other expressions to use the result of those expressions. Conditional: Within eachTargetTrackingMetricDataQueryobject, you must specify eitherExpressionorMetricStat, but not both.id (
Optional[str]) – A short name that identifies the object’s results in the response. This name must be unique among allMetricDataQueryobjects 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 eachMetricDataQueryobject, you must specify eitherExpressionorMetricStat, 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, specifytruefor this value for only the final math expression that the metric specification is based on. You must specifyfalseforReturnDatafor 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 forReturnData. This sets it to its default (true).
- See:
- 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
Idof the other metrics to refer to those metrics, and can also use theIdof other expressions to use the result of those expressions.Conditional: Within each
TargetTrackingMetricDataQueryobject, you must specify eitherExpressionorMetricStat, but not both.
- id
A short name that identifies the object’s results in the response.
This name must be unique among all
MetricDataQueryobjects 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
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
Information about the metric data to return.
Conditional: Within each
MetricDataQueryobject, you must specify eitherExpressionorMetricStat, but not both.
- return_data
Indicates whether to return the timestamps and raw data values of this metric.
If you use any math expressions, specify
truefor this value for only the final math expression that the metric specification is based on. You must specifyfalseforReturnDatafor 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).
TargetTrackingMetricDimensionProperty
- class CfnScalingPolicyPropsMixin.TargetTrackingMetricDimensionProperty(*, name=None, value=None)
Bases:
objectTargetTrackingMetricDimensionspecifies a name/value pair that is part of the identity of a CloudWatch metric for theDimensionsproperty 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:
- 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.
TargetTrackingMetricProperty
- class CfnScalingPolicyPropsMixin.TargetTrackingMetricProperty(*, dimensions=None, metric_name=None, namespace=None)
Bases:
objectRepresents 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:
dimensions (
Union[IResolvable,Sequence[Union[IResolvable,TargetTrackingMetricDimensionProperty,Dict[str,Any]]],None]) –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.
metric_name (
Optional[str]) – The name of the metric.namespace (
Optional[str]) –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:
- 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.
- metric_name
The name of the metric.
- 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 .
TargetTrackingMetricStatProperty
- class CfnScalingPolicyPropsMixin.TargetTrackingMetricStatProperty(*, metric=None, stat=None, unit=None)
Bases:
objectThis structure defines the CloudWatch metric to return, along with the statistic and unit.
TargetTrackingMetricStatis 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:
- 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 .
- 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.
- 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 .
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:
objectTargetTrackingScalingPolicyConfigurationis 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 istrue, 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 isfalse.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:
- 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.
- 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 isfalse.
- predefined_metric_specification
A predefined metric.
You can specify either a predefined metric or a customized metric.
- 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 .
- 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 .
- 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.