Class TargetTrackingScalingPolicy.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<TargetTrackingScalingPolicy>
- Enclosing class:
TargetTrackingScalingPolicy
TargetTrackingScalingPolicy
.-
Method Summary
Modifier and TypeMethodDescriptionautoScalingGroup
(IAutoScalingGroup autoScalingGroup) build()
Period after a scaling completes before another scaling activity can start.customMetric
(IMetric customMetric) A custom metric for application autoscaling.disableScaleIn
(Boolean disableScaleIn) Indicates whether scale in by the target tracking policy is disabled.estimatedInstanceWarmup
(Duration estimatedInstanceWarmup) Estimated time until a newly launched instance can send metrics to CloudWatch.predefinedMetric
(PredefinedMetric predefinedMetric) A predefined metric for application autoscaling.resourceLabel
(String resourceLabel) The resource label associated with the predefined metric.targetValue
(Number targetValue) The target value for the metric.
-
Method Details
-
create
@Stability(Stable) public static TargetTrackingScalingPolicy.Builder create(software.constructs.Construct scope, String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.- Returns:
- a new instance of
TargetTrackingScalingPolicy.Builder
.
-
cooldown
Period after a scaling completes before another scaling activity can start.Default: - The default cooldown configured on the AutoScalingGroup.
- Parameters:
cooldown
- Period after a scaling completes before another scaling activity can start. This parameter is required.- Returns:
this
-
disableScaleIn
@Stability(Stable) public TargetTrackingScalingPolicy.Builder disableScaleIn(Boolean 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.
Default: false
- Parameters:
disableScaleIn
- Indicates whether scale in by the target tracking policy is disabled. This parameter is required.- Returns:
this
-
estimatedInstanceWarmup
@Stability(Stable) public TargetTrackingScalingPolicy.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
-
targetValue
The target value for the metric.- Parameters:
targetValue
- The target value for the metric. This parameter is required.- Returns:
this
-
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.
Default: - No custom metric.
- Parameters:
customMetric
- A custom metric for application autoscaling. This parameter is required.- Returns:
this
-
predefinedMetric
@Stability(Stable) public TargetTrackingScalingPolicy.Builder predefinedMetric(PredefinedMetric 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.
Default: - No predefined metric.
- Parameters:
predefinedMetric
- A predefined metric for application autoscaling. This parameter is required.- Returns:
this
-
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>
Default: - No resource label.
- Parameters:
resourceLabel
- The resource label associated with the predefined metric. This parameter is required.- Returns:
this
-
autoScalingGroup
@Stability(Stable) public TargetTrackingScalingPolicy.Builder autoScalingGroup(IAutoScalingGroup autoScalingGroup) - Parameters:
autoScalingGroup
- This parameter is required.- Returns:
this
-
build
- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<TargetTrackingScalingPolicy>
- Returns:
- a newly built instance of
TargetTrackingScalingPolicy
.
-