Class TargetTrackingScalingPolicy.Builder

java.lang.Object
software.amazon.awscdk.services.autoscaling.TargetTrackingScalingPolicy.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<TargetTrackingScalingPolicy>
Enclosing class:
TargetTrackingScalingPolicy

@Stability(Stable) public static final class TargetTrackingScalingPolicy.Builder extends Object implements software.amazon.jsii.Builder<TargetTrackingScalingPolicy>
A fluent builder for TargetTrackingScalingPolicy.
  • 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

      @Stability(Stable) public TargetTrackingScalingPolicy.Builder cooldown(Duration 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

      @Stability(Stable) public TargetTrackingScalingPolicy.Builder targetValue(Number targetValue)
      The target value for the metric.

      Parameters:
      targetValue - The target value for the metric. This parameter is required.
      Returns:
      this
    • customMetric

      @Stability(Stable) public TargetTrackingScalingPolicy.Builder customMetric(IMetric 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

      @Stability(Stable) public TargetTrackingScalingPolicy.Builder resourceLabel(String 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

      @Stability(Stable) public TargetTrackingScalingPolicy build()
      Specified by:
      build in interface software.amazon.jsii.Builder<TargetTrackingScalingPolicy>
      Returns:
      a newly built instance of TargetTrackingScalingPolicy.