Class BasicStepScalingPolicyProps.Builder
java.lang.Object
software.amazon.awscdk.services.autoscaling.BasicStepScalingPolicyProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<BasicStepScalingPolicyProps>
- Enclosing interface:
BasicStepScalingPolicyProps
@Stability(Stable)
public static final class BasicStepScalingPolicyProps.Builder
extends Object
implements software.amazon.jsii.Builder<BasicStepScalingPolicyProps>
A builder for
BasicStepScalingPolicyProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadjustmentType
(AdjustmentType adjustmentType) Sets the value ofBasicStepScalingPolicyProps.getAdjustmentType()
build()
Builds the configured instance.Sets the value ofBasicStepScalingPolicyProps.getCooldown()
datapointsToAlarm
(Number datapointsToAlarm) Sets the value ofBasicStepScalingPolicyProps.getDatapointsToAlarm()
estimatedInstanceWarmup
(Duration estimatedInstanceWarmup) Sets the value ofBasicStepScalingPolicyProps.getEstimatedInstanceWarmup()
evaluationPeriods
(Number evaluationPeriods) Sets the value ofBasicStepScalingPolicyProps.getEvaluationPeriods()
Sets the value ofBasicStepScalingPolicyProps.getMetric()
metricAggregationType
(MetricAggregationType metricAggregationType) Sets the value ofBasicStepScalingPolicyProps.getMetricAggregationType()
minAdjustmentMagnitude
(Number minAdjustmentMagnitude) Sets the value ofBasicStepScalingPolicyProps.getMinAdjustmentMagnitude()
scalingSteps
(List<? extends ScalingInterval> scalingSteps) Sets the value ofBasicStepScalingPolicyProps.getScalingSteps()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
metric
Sets the value ofBasicStepScalingPolicyProps.getMetric()
- Parameters:
metric
- Metric to scale on. This parameter is required.- Returns:
this
-
scalingSteps
@Stability(Stable) public BasicStepScalingPolicyProps.Builder scalingSteps(List<? extends ScalingInterval> scalingSteps) Sets the value ofBasicStepScalingPolicyProps.getScalingSteps()
- Parameters:
scalingSteps
- The intervals for scaling. This parameter is required. Maps a range of metric values to a particular scaling behavior.Must be between 2 and 40 steps.
- Returns:
this
-
adjustmentType
@Stability(Stable) public BasicStepScalingPolicyProps.Builder adjustmentType(AdjustmentType adjustmentType) Sets the value ofBasicStepScalingPolicyProps.getAdjustmentType()
- Parameters:
adjustmentType
- How the adjustment numbers inside 'intervals' are interpreted.- Returns:
this
-
cooldown
Sets the value ofBasicStepScalingPolicyProps.getCooldown()
- Parameters:
cooldown
- Grace period after scaling activity.- Returns:
this
-
datapointsToAlarm
@Stability(Stable) public BasicStepScalingPolicyProps.Builder datapointsToAlarm(Number datapointsToAlarm) Sets the value ofBasicStepScalingPolicyProps.getDatapointsToAlarm()
- Parameters:
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 forevaluationPeriods
is the N value.Only has meaning if
evaluationPeriods != 1
. Must be less than or equal toevaluationPeriods
.- Returns:
this
-
estimatedInstanceWarmup
@Stability(Stable) public BasicStepScalingPolicyProps.Builder estimatedInstanceWarmup(Duration estimatedInstanceWarmup) Sets the value ofBasicStepScalingPolicyProps.getEstimatedInstanceWarmup()
- Parameters:
estimatedInstanceWarmup
- Estimated time until a newly launched instance can send metrics to CloudWatch.- Returns:
this
-
evaluationPeriods
@Stability(Stable) public BasicStepScalingPolicyProps.Builder evaluationPeriods(Number evaluationPeriods) Sets the value ofBasicStepScalingPolicyProps.getEvaluationPeriods()
- Parameters:
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.- Returns:
this
-
metricAggregationType
@Stability(Stable) public BasicStepScalingPolicyProps.Builder metricAggregationType(MetricAggregationType metricAggregationType) Sets the value ofBasicStepScalingPolicyProps.getMetricAggregationType()
- Parameters:
metricAggregationType
- Aggregation to apply to all data points over the evaluation periods. Only has meaning ifevaluationPeriods != 1
.- Returns:
this
-
minAdjustmentMagnitude
@Stability(Stable) public BasicStepScalingPolicyProps.Builder minAdjustmentMagnitude(Number minAdjustmentMagnitude) Sets the value ofBasicStepScalingPolicyProps.getMinAdjustmentMagnitude()
- Parameters:
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.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<BasicStepScalingPolicyProps>
- Returns:
- a new instance of
BasicStepScalingPolicyProps
- Throws:
NullPointerException
- if any required attribute was not provided
-