- class aws_cdk.aws_applicationautoscaling.StepScalingPolicy(scope, id, *, scaling_target, metric, scaling_steps, adjustment_type=None, cooldown=None, datapoints_to_alarm=None, evaluation_periods=None, metric_aggregation_type=None, min_adjustment_magnitude=None)
Define a scaling strategy which scales depending on absolute values of some metric.
You can specify the scaling behavior for various values of the metric.
Implemented using one or more CloudWatch alarms and Step Scaling Policies.
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk as cdk from aws_cdk import aws_applicationautoscaling as appscaling from aws_cdk import aws_cloudwatch as cloudwatch # metric: cloudwatch.Metric # scalable_target: appscaling.ScalableTarget step_scaling_policy = appscaling.StepScalingPolicy(self, "MyStepScalingPolicy", metric=metric, scaling_steps=[appscaling.ScalingInterval( change=123, # the properties below are optional lower=123, upper=123 )], scaling_target=scalable_target, # the properties below are optional adjustment_type=appscaling.AdjustmentType.CHANGE_IN_CAPACITY, cooldown=cdk.Duration.minutes(30), datapoints_to_alarm=123, evaluation_periods=123, metric_aggregation_type=appscaling.MetricAggregationType.AVERAGE, min_adjustment_magnitude=123 )
IScalableTarget) – The scaling target.
IMetric) – Metric to scale on.
Any]]]) – The intervals for scaling. Maps a range of metric values to a particular scaling behavior. Must be between 2 and 40 steps.
AdjustmentType]) – How the adjustment numbers inside ‘intervals’ are interpreted. Default: ChangeInCapacity
Duration]) – Grace period after scaling activity. Subsequent scale outs during the cooldown period are squashed so that only the biggest scale out happens. Subsequent scale ins during the cooldown period are ignored. Default: No cooldown period
None]) – The number of data points out of the evaluation periods that must be breaching to trigger a scaling action. Creates an “M out of N” alarm, where this property is the M and the value set for
evaluationPeriodsis the N value. Only has meaning if
evaluationPeriods != 1. Default:
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. If
datapointsToAlarmis not set, then all data points in the evaluation period must meet the criteria to trigger a scaling action. Default: 1
MetricAggregationType]) – 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.
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 effect
Returns a string representation of this construct.
- Return type:
The tree node.
- classmethod is_construct(x)
xis a construct.
Use this method instead of
instanceofto properly detect
Constructinstances, even when the construct library is symlinked.
constructslibrary on disk are seen as independent, completely different libraries. As a consequence, the class
Constructin each copy of the
constructslibrary is seen as a different class, and an instance of one class will not test as
instanceofthe other class.
npm installwill not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the
constructslibrary can be accidentally installed, and
instanceofwill behave unpredictably. It is safest to avoid using
instanceof, and using this type-testing method instead.
Any) – Any object.
- Return type:
xis an object created from a class which extends