StepScalingPolicyProps
- class aws_cdk.aws_autoscaling.StepScalingPolicyProps(*, metric, scaling_steps, adjustment_type=None, cooldown=None, estimated_instance_warmup=None, evaluation_periods=None, metric_aggregation_type=None, min_adjustment_magnitude=None, auto_scaling_group)
Bases:
BasicStepScalingPolicyProps
- Parameters:
metric (
IMetric
) – Metric to scale on.scaling_steps (
Sequence
[Union
[ScalingInterval
,Dict
[str
,Any
]]]) – The intervals for scaling. Maps a range of metric values to a particular scaling behavior.adjustment_type (
Optional
[AdjustmentType
]) – How the adjustment numbers inside ‘intervals’ are interpreted. Default: ChangeInCapacitycooldown (
Optional
[Duration
]) – Grace period after scaling activity. Default: Default cooldown period on your AutoScalingGroupestimated_instance_warmup (
Optional
[Duration
]) – Estimated time until a newly launched instance can send metrics to CloudWatch. Default: Same as the cooldownevaluation_periods (
Union
[int
,float
,None
]) – How many evaluation periods of the metric to wait before triggering a scaling action. Raising this value can be used to smooth out the metric, at the expense of slower response times. Default: 1metric_aggregation_type (
Optional
[MetricAggregationType
]) – Aggregation to apply to all data points over the evaluation periods. Only has meaning ifevaluationPeriods != 1
. Default: - The statistic from the metric if applicable (MIN, MAX, AVERAGE), otherwise AVERAGE.min_adjustment_magnitude (
Union
[int
,float
,None
]) – Minimum absolute number to adjust capacity with as result of percentage scaling. Only when using AdjustmentType = PercentChangeInCapacity, this number controls the minimum absolute effect size. Default: No minimum scaling effectauto_scaling_group (
IAutoScalingGroup
) – The auto scaling group.
- 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_autoscaling as autoscaling import aws_cdk.aws_cloudwatch as cloudwatch import aws_cdk.core as cdk # auto_scaling_group: autoscaling.AutoScalingGroup # metric: cloudwatch.Metric step_scaling_policy_props = autoscaling.StepScalingPolicyProps( auto_scaling_group=auto_scaling_group, metric=metric, scaling_steps=[autoscaling.ScalingInterval( change=123, # the properties below are optional lower=123, upper=123 )], # the properties below are optional adjustment_type=autoscaling.AdjustmentType.CHANGE_IN_CAPACITY, cooldown=cdk.Duration.minutes(30), estimated_instance_warmup=cdk.Duration.minutes(30), evaluation_periods=123, metric_aggregation_type=autoscaling.MetricAggregationType.AVERAGE, min_adjustment_magnitude=123 )
Attributes
- adjustment_type
How the adjustment numbers inside ‘intervals’ are interpreted.
- Default:
ChangeInCapacity
- auto_scaling_group
The auto scaling group.
- cooldown
Grace period after scaling activity.
- Default:
Default cooldown period on your AutoScalingGroup
- estimated_instance_warmup
Estimated time until a newly launched instance can send metrics to CloudWatch.
- Default:
Same as the cooldown
- evaluation_periods
How many evaluation periods of the metric to wait before triggering a scaling action.
Raising this value can be used to smooth out the metric, at the expense of slower response times.
- Default:
1
- metric
Metric to scale on.
- metric_aggregation_type
Aggregation to apply to all data points over the evaluation periods.
Only has meaning if
evaluationPeriods != 1
.- Default:
The statistic from the metric if applicable (MIN, MAX, AVERAGE), otherwise AVERAGE.
- min_adjustment_magnitude
Minimum absolute number to adjust capacity with as result of percentage scaling.
Only when using AdjustmentType = PercentChangeInCapacity, this number controls the minimum absolute effect size.
- Default:
No minimum scaling effect
- scaling_steps
The intervals for scaling.
Maps a range of metric values to a particular scaling behavior.