Class MetricTargetTrackingProps.Builder
java.lang.Object
software.amazon.awscdk.services.autoscaling.MetricTargetTrackingProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<MetricTargetTrackingProps>
- Enclosing interface:
MetricTargetTrackingProps
@Stability(Stable)
public static final class MetricTargetTrackingProps.Builder
extends Object
implements software.amazon.jsii.Builder<MetricTargetTrackingProps>
A builder for
MetricTargetTrackingProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.Sets the value ofBaseTargetTrackingProps.getCooldown()
disableScaleIn
(Boolean disableScaleIn) Sets the value ofBaseTargetTrackingProps.getDisableScaleIn()
estimatedInstanceWarmup
(Duration estimatedInstanceWarmup) Sets the value ofBaseTargetTrackingProps.getEstimatedInstanceWarmup()
Sets the value ofMetricTargetTrackingProps.getMetric()
targetValue
(Number targetValue) Sets the value ofMetricTargetTrackingProps.getTargetValue()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
metric
Sets the value ofMetricTargetTrackingProps.getMetric()
- Parameters:
metric
- Metric to track. This parameter is required. The metric must represent a utilization, so that if it's higher than the target value, your ASG should scale out, and if it's lower it should scale in.- Returns:
this
-
targetValue
Sets the value ofMetricTargetTrackingProps.getTargetValue()
- Parameters:
targetValue
- Value to keep the metric around. This parameter is required.- Returns:
this
-
cooldown
Sets the value ofBaseTargetTrackingProps.getCooldown()
- Parameters:
cooldown
- Period after a scaling completes before another scaling activity can start.- Returns:
this
-
disableScaleIn
Sets the value ofBaseTargetTrackingProps.getDisableScaleIn()
- Parameters:
disableScaleIn
- Indicates whether scale in by the target tracking policy is disabled. If the value is true, scale in is disabled and the target tracking policy won't remove capacity from the autoscaling group. Otherwise, scale in is enabled and the target tracking policy can remove capacity from the group.- Returns:
this
-
estimatedInstanceWarmup
@Stability(Stable) public MetricTargetTrackingProps.Builder estimatedInstanceWarmup(Duration estimatedInstanceWarmup) Sets the value ofBaseTargetTrackingProps.getEstimatedInstanceWarmup()
- Parameters:
estimatedInstanceWarmup
- Estimated time until a newly launched instance can send metrics to CloudWatch.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<MetricTargetTrackingProps>
- Returns:
- a new instance of
MetricTargetTrackingProps
- Throws:
NullPointerException
- if any required attribute was not provided
-