Class TargetTrackingScalingPolicyProps.Builder
java.lang.Object
software.amazon.awscdk.services.applicationautoscaling.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 TypeMethodDescriptionbuild()
Builds the configured instance.customMetric
(IMetric customMetric) Sets the value ofBasicTargetTrackingScalingPolicyProps.getCustomMetric()
disableScaleIn
(Boolean disableScaleIn) Sets the value ofBaseTargetTrackingProps.getDisableScaleIn()
policyName
(String policyName) Sets the value ofBaseTargetTrackingProps.getPolicyName()
predefinedMetric
(PredefinedMetric predefinedMetric) Sets the value ofBasicTargetTrackingScalingPolicyProps.getPredefinedMetric()
resourceLabel
(String resourceLabel) Sets the value ofBasicTargetTrackingScalingPolicyProps.getResourceLabel()
scaleInCooldown
(Duration scaleInCooldown) Sets the value ofBaseTargetTrackingProps.getScaleInCooldown()
scaleOutCooldown
(Duration scaleOutCooldown) Sets the value ofBaseTargetTrackingProps.getScaleOutCooldown()
scalingTarget
(IScalableTarget scalingTarget) Sets the value ofTargetTrackingScalingPolicyProps.getScalingTarget()
targetValue
(Number targetValue) Sets the value ofBasicTargetTrackingScalingPolicyProps.getTargetValue()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
scalingTarget
@Stability(Stable) public TargetTrackingScalingPolicyProps.Builder scalingTarget(IScalableTarget scalingTarget) Sets the value ofTargetTrackingScalingPolicyProps.getScalingTarget()
- Parameters:
scalingTarget
- 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
- Identify the resource associated with the metric type. Only used for predefined metric ALBRequestCountPerTarget.Example value:
app/<load-balancer-name>/<load-balancer-id>/targetgroup/<target-group-name>/<target-group-id>
- 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 scalable resource. Otherwise, scale in is enabled and the target tracking policy can remove capacity from the scalable resource.- Returns:
this
-
policyName
Sets the value ofBaseTargetTrackingProps.getPolicyName()
- Parameters:
policyName
- A name for the scaling policy.- Returns:
this
-
scaleInCooldown
@Stability(Stable) public TargetTrackingScalingPolicyProps.Builder scaleInCooldown(Duration scaleInCooldown) Sets the value ofBaseTargetTrackingProps.getScaleInCooldown()
- Parameters:
scaleInCooldown
- Period after a scale in activity completes before another scale in activity can start.- Returns:
this
-
scaleOutCooldown
@Stability(Stable) public TargetTrackingScalingPolicyProps.Builder scaleOutCooldown(Duration scaleOutCooldown) Sets the value ofBaseTargetTrackingProps.getScaleOutCooldown()
- Parameters:
scaleOutCooldown
- Period after a scale out activity completes before another scale out activity can start.- 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
-