Class StepScalingPolicy.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<StepScalingPolicy>
- Enclosing class:
StepScalingPolicy
StepScalingPolicy
.-
Method Summary
Modifier and TypeMethodDescriptionadjustmentType
(AdjustmentType adjustmentType) How the adjustment numbers inside 'intervals' are interpreted.autoScalingGroup
(IAutoScalingGroup autoScalingGroup) The auto scaling group.build()
Grace period after scaling activity.static StepScalingPolicy.Builder
datapointsToAlarm
(Number datapointsToAlarm) The number of data points out of the evaluation periods that must be breaching to trigger a scaling action.estimatedInstanceWarmup
(Duration estimatedInstanceWarmup) Estimated time until a newly launched instance can send metrics to CloudWatch.evaluationPeriods
(Number evaluationPeriods) How many evaluation periods of the metric to wait before triggering a scaling action.Metric to scale on.metricAggregationType
(MetricAggregationType metricAggregationType) Aggregation to apply to all data points over the evaluation periods.minAdjustmentMagnitude
(Number minAdjustmentMagnitude) Minimum absolute number to adjust capacity with as result of percentage scaling.scalingSteps
(List<? extends ScalingInterval> scalingSteps) The intervals for scaling.
-
Method Details
-
create
@Stability(Stable) public static StepScalingPolicy.Builder create(software.constructs.Construct scope, String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.- Returns:
- a new instance of
StepScalingPolicy.Builder
.
-
metric
Metric to scale on.- Parameters:
metric
- Metric to scale on. This parameter is required.- Returns:
this
-
scalingSteps
@Stability(Stable) public StepScalingPolicy.Builder scalingSteps(List<? extends ScalingInterval> scalingSteps) The intervals for scaling.Maps a range of metric values to a particular scaling behavior.
Must be between 2 and 40 steps.
- Parameters:
scalingSteps
- The intervals for scaling. This parameter is required.- Returns:
this
-
adjustmentType
How the adjustment numbers inside 'intervals' are interpreted.Default: ChangeInCapacity
- Parameters:
adjustmentType
- How the adjustment numbers inside 'intervals' are interpreted. This parameter is required.- Returns:
this
-
cooldown
Grace period after scaling activity.Default: Default cooldown period on your AutoScalingGroup
- Parameters:
cooldown
- Grace period after scaling activity. This parameter is required.- Returns:
this
-
datapointsToAlarm
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
evaluationPeriods
is the N value.Only has meaning if
evaluationPeriods != 1
. Must be less than or equal toevaluationPeriods
.Default: - Same as `evaluationPeriods`
- Parameters:
datapointsToAlarm
- The number of data points out of the evaluation periods that must be breaching to trigger a scaling action. This parameter is required.- Returns:
this
-
estimatedInstanceWarmup
@Stability(Stable) public StepScalingPolicy.Builder estimatedInstanceWarmup(Duration estimatedInstanceWarmup) Estimated time until a newly launched instance can send metrics to CloudWatch.Default: Same as the cooldown
- Parameters:
estimatedInstanceWarmup
- Estimated time until a newly launched instance can send metrics to CloudWatch. This parameter is required.- Returns:
this
-
evaluationPeriods
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
datapointsToAlarm
is not set, then all data points in the evaluation period must meet the criteria to trigger a scaling action.Default: 1
- Parameters:
evaluationPeriods
- How many evaluation periods of the metric to wait before triggering a scaling action. This parameter is required.- Returns:
this
-
metricAggregationType
@Stability(Stable) public StepScalingPolicy.Builder metricAggregationType(MetricAggregationType 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.
- Parameters:
metricAggregationType
- Aggregation to apply to all data points over the evaluation periods. This parameter is required.- Returns:
this
-
minAdjustmentMagnitude
@Stability(Stable) public StepScalingPolicy.Builder minAdjustmentMagnitude(Number minAdjustmentMagnitude) 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
- Parameters:
minAdjustmentMagnitude
- Minimum absolute number to adjust capacity with as result of percentage scaling. This parameter is required.- Returns:
this
-
autoScalingGroup
@Stability(Stable) public StepScalingPolicy.Builder autoScalingGroup(IAutoScalingGroup autoScalingGroup) The auto scaling group.- Parameters:
autoScalingGroup
- The auto scaling group. This parameter is required.- Returns:
this
-
build
- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<StepScalingPolicy>
- Returns:
- a newly built instance of
StepScalingPolicy
.
-