Class TargetTrackingScalingPolicyProps.Builder
java.lang.Object
software.amazon.awscdk.services.autoscaling.TargetTrackingScalingPolicyProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<TargetTrackingScalingPolicyProps>
- Enclosing interface:
TargetTrackingScalingPolicyProps
@Stability(Stable)
public static final class TargetTrackingScalingPolicyProps.Builder
extends Object
implements software.amazon.jsii.Builder<TargetTrackingScalingPolicyProps>
A builder for
TargetTrackingScalingPolicyProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionautoScalingGroup
(IAutoScalingGroup autoScalingGroup) Sets the value ofTargetTrackingScalingPolicyProps.getAutoScalingGroup()
build()
Builds the configured instance.Sets the value ofBaseTargetTrackingProps.getCooldown()
customMetric
(IMetric customMetric) Sets the value ofBasicTargetTrackingScalingPolicyProps.getCustomMetric()
disableScaleIn
(Boolean disableScaleIn) Sets the value ofBaseTargetTrackingProps.getDisableScaleIn()
estimatedInstanceWarmup
(Duration estimatedInstanceWarmup) Sets the value ofBaseTargetTrackingProps.getEstimatedInstanceWarmup()
predefinedMetric
(PredefinedMetric predefinedMetric) Sets the value ofBasicTargetTrackingScalingPolicyProps.getPredefinedMetric()
resourceLabel
(String resourceLabel) Sets the value ofBasicTargetTrackingScalingPolicyProps.getResourceLabel()
targetValue
(Number targetValue) Sets the value ofBasicTargetTrackingScalingPolicyProps.getTargetValue()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
autoScalingGroup
@Stability(Stable) public TargetTrackingScalingPolicyProps.Builder autoScalingGroup(IAutoScalingGroup autoScalingGroup) Sets the value ofTargetTrackingScalingPolicyProps.getAutoScalingGroup()
- Parameters:
autoScalingGroup
- the value to be set. This parameter is required.- Returns:
this
-
targetValue
Sets the value ofBasicTargetTrackingScalingPolicyProps.getTargetValue()
- Parameters:
targetValue
- The target value for the metric. This parameter is required.- Returns:
this
-
customMetric
@Stability(Stable) public TargetTrackingScalingPolicyProps.Builder customMetric(IMetric customMetric) Sets the value ofBasicTargetTrackingScalingPolicyProps.getCustomMetric()
- Parameters:
customMetric
- A custom metric for application autoscaling. The metric must track utilization. Scaling out will happen if the metric is higher than the target value, scaling in will happen in the metric is lower than the target value.Exactly one of customMetric or predefinedMetric must be specified.
- Returns:
this
-
predefinedMetric
@Stability(Stable) public TargetTrackingScalingPolicyProps.Builder predefinedMetric(PredefinedMetric predefinedMetric) Sets the value ofBasicTargetTrackingScalingPolicyProps.getPredefinedMetric()
- Parameters:
predefinedMetric
- A predefined metric for application autoscaling. The metric must track utilization. Scaling out will happen if the metric is higher than the target value, scaling in will happen in the metric is lower than the target value.Exactly one of customMetric or predefinedMetric must be specified.
- Returns:
this
-
resourceLabel
@Stability(Stable) public TargetTrackingScalingPolicyProps.Builder resourceLabel(String resourceLabel) Sets the value ofBasicTargetTrackingScalingPolicyProps.getResourceLabel()
- Parameters:
resourceLabel
- The resource label associated with the predefined metric. Should be supplied if the predefined metric is ALBRequestCountPerTarget, and the format should be:app/invalid input: '<'load-balancer-name>/invalid input: '<'load-balancer-id>/targetgroup/invalid input: '<'target-group-name>/invalid input: '<'target-group-id>
- Returns:
this
-
cooldown
Sets the value ofBaseTargetTrackingProps.getCooldown()
- Parameters:
cooldown
- Period after a scaling completes before another scaling activity can start.- Returns:
this
-
disableScaleIn
@Stability(Stable) public TargetTrackingScalingPolicyProps.Builder disableScaleIn(Boolean 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 TargetTrackingScalingPolicyProps.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<TargetTrackingScalingPolicyProps>
- Returns:
- a new instance of
TargetTrackingScalingPolicyProps
- Throws:
NullPointerException
- if any required attribute was not provided
-