public static final class TargetTrackingScalingPolicy.Builder
extends java.lang.Object
TargetTrackingScalingPolicy
.Modifier and Type | Method and Description |
---|---|
TargetTrackingScalingPolicy |
build() |
static TargetTrackingScalingPolicy.Builder |
create(software.constructs.Construct scope,
java.lang.String id) |
TargetTrackingScalingPolicy.Builder |
customMetric(IMetric customMetric)
A custom metric for application autoscaling.
|
TargetTrackingScalingPolicy.Builder |
disableScaleIn(java.lang.Boolean disableScaleIn)
Indicates whether scale in by the target tracking policy is disabled.
|
TargetTrackingScalingPolicy.Builder |
policyName(java.lang.String policyName)
A name for the scaling policy.
|
TargetTrackingScalingPolicy.Builder |
predefinedMetric(PredefinedMetric predefinedMetric)
A predefined metric for application autoscaling.
|
TargetTrackingScalingPolicy.Builder |
resourceLabel(java.lang.String resourceLabel)
Identify the resource associated with the metric type.
|
TargetTrackingScalingPolicy.Builder |
scaleInCooldown(Duration scaleInCooldown)
Period after a scale in activity completes before another scale in activity can start.
|
TargetTrackingScalingPolicy.Builder |
scaleOutCooldown(Duration scaleOutCooldown)
Period after a scale out activity completes before another scale out activity can start.
|
TargetTrackingScalingPolicy.Builder |
scalingTarget(IScalableTarget scalingTarget) |
TargetTrackingScalingPolicy.Builder |
targetValue(java.lang.Number targetValue)
The target value for the metric.
|
public static TargetTrackingScalingPolicy.Builder create(software.constructs.Construct scope, java.lang.String id)
scope
- This parameter is required.id
- This parameter is required.TargetTrackingScalingPolicy.Builder
.public TargetTrackingScalingPolicy.Builder disableScaleIn(java.lang.Boolean disableScaleIn)
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.
Default: false
disableScaleIn
- Indicates whether scale in by the target tracking policy is disabled. This parameter is required.this
public TargetTrackingScalingPolicy.Builder policyName(java.lang.String policyName)
Default: - Automatically generated name.
policyName
- A name for the scaling policy. This parameter is required.this
public TargetTrackingScalingPolicy.Builder scaleInCooldown(Duration scaleInCooldown)
Default: Duration.seconds(300) for the following scalable targets: ECS services, Spot Fleet requests, EMR clusters, AppStream 2.0 fleets, Aurora DB clusters, Amazon SageMaker endpoint variants, Custom resources. For all other scalable targets, the default value is Duration.seconds(0): DynamoDB tables, DynamoDB global secondary indexes, Amazon Comprehend document classification endpoints, Lambda provisioned concurrency
scaleInCooldown
- Period after a scale in activity completes before another scale in activity can start. This parameter is required.this
public TargetTrackingScalingPolicy.Builder scaleOutCooldown(Duration scaleOutCooldown)
Default: Duration.seconds(300) for the following scalable targets: ECS services, Spot Fleet requests, EMR clusters, AppStream 2.0 fleets, Aurora DB clusters, Amazon SageMaker endpoint variants, Custom resources. For all other scalable targets, the default value is Duration.seconds(0): DynamoDB tables, DynamoDB global secondary indexes, Amazon Comprehend document classification endpoints, Lambda provisioned concurrency
scaleOutCooldown
- Period after a scale out activity completes before another scale out activity can start. This parameter is required.this
public TargetTrackingScalingPolicy.Builder targetValue(java.lang.Number targetValue)
targetValue
- The target value for the metric. This parameter is required.this
public TargetTrackingScalingPolicy.Builder customMetric(IMetric customMetric)
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.
customMetric
- A custom metric for application autoscaling. This parameter is required.this
public TargetTrackingScalingPolicy.Builder predefinedMetric(PredefinedMetric predefinedMetric)
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 metrics.
predefinedMetric
- A predefined metric for application autoscaling. This parameter is required.this
public TargetTrackingScalingPolicy.Builder resourceLabel(java.lang.String resourceLabel)
Only used for predefined metric ALBRequestCountPerTarget.
Example value: app/<load-balancer-name>/<load-balancer-id>/targetgroup/<target-group-name>/<target-group-id>
Default: - No resource label.
resourceLabel
- Identify the resource associated with the metric type. This parameter is required.this
public TargetTrackingScalingPolicy.Builder scalingTarget(IScalableTarget scalingTarget)
scalingTarget
- This parameter is required.this
public TargetTrackingScalingPolicy build()