Interface ScalingPolicy.Builder

  • Method Details

    • autoScalingGroupName

      ScalingPolicy.Builder autoScalingGroupName(String autoScalingGroupName)

      The name of the Auto Scaling group.

      Parameters:
      autoScalingGroupName - The name of the Auto Scaling group.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • policyName

      ScalingPolicy.Builder policyName(String policyName)

      The name of the scaling policy.

      Parameters:
      policyName - The name of the scaling policy.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • policyARN

      ScalingPolicy.Builder policyARN(String policyARN)

      The Amazon Resource Name (ARN) of the policy.

      Parameters:
      policyARN - The Amazon Resource Name (ARN) of the policy.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • policyType

      ScalingPolicy.Builder policyType(String policyType)

      One of the following policy types:

      • TargetTrackingScaling

      • StepScaling

      • SimpleScaling (default)

      • PredictiveScaling

      For more information, see Target tracking scaling policies and Step and simple scaling policies in the Amazon EC2 Auto Scaling User Guide.

      Parameters:
      policyType - One of the following policy types:

      • TargetTrackingScaling

      • StepScaling

      • SimpleScaling (default)

      • PredictiveScaling

      For more information, see Target tracking scaling policies and Step and simple scaling policies in the Amazon EC2 Auto Scaling User Guide.

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • adjustmentType

      ScalingPolicy.Builder adjustmentType(String adjustmentType)

      Specifies how the scaling adjustment is interpreted (for example, an absolute number or a percentage). The valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

      Parameters:
      adjustmentType - Specifies how the scaling adjustment is interpreted (for example, an absolute number or a percentage). The valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • minAdjustmentStep

      ScalingPolicy.Builder minAdjustmentStep(Integer minAdjustmentStep)

      Available for backward compatibility. Use MinAdjustmentMagnitude instead.

      Parameters:
      minAdjustmentStep - Available for backward compatibility. Use MinAdjustmentMagnitude instead.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • minAdjustmentMagnitude

      ScalingPolicy.Builder minAdjustmentMagnitude(Integer minAdjustmentMagnitude)

      The minimum value to scale by when the adjustment type is PercentChangeInCapacity.

      Parameters:
      minAdjustmentMagnitude - The minimum value to scale by when the adjustment type is PercentChangeInCapacity.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • scalingAdjustment

      ScalingPolicy.Builder scalingAdjustment(Integer scalingAdjustment)

      The amount by which to scale, based on the specified adjustment type. A positive value adds to the current capacity while a negative number removes from the current capacity.

      Parameters:
      scalingAdjustment - The amount by which to scale, based on the specified adjustment type. A positive value adds to the current capacity while a negative number removes from the current capacity.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • cooldown

      ScalingPolicy.Builder cooldown(Integer cooldown)

      The duration of the policy's cooldown period, in seconds.

      Parameters:
      cooldown - The duration of the policy's cooldown period, in seconds.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • stepAdjustments

      ScalingPolicy.Builder stepAdjustments(Collection<StepAdjustment> stepAdjustments)

      A set of adjustments that enable you to scale based on the size of the alarm breach.

      Parameters:
      stepAdjustments - A set of adjustments that enable you to scale based on the size of the alarm breach.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • stepAdjustments

      ScalingPolicy.Builder stepAdjustments(StepAdjustment... stepAdjustments)

      A set of adjustments that enable you to scale based on the size of the alarm breach.

      Parameters:
      stepAdjustments - A set of adjustments that enable you to scale based on the size of the alarm breach.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • stepAdjustments

      ScalingPolicy.Builder stepAdjustments(Consumer<StepAdjustment.Builder>... stepAdjustments)

      A set of adjustments that enable you to scale based on the size of the alarm breach.

      This is a convenience method that creates an instance of the StepAdjustment.Builder avoiding the need to create one manually via StepAdjustment.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to stepAdjustments(List<StepAdjustment>).

      Parameters:
      stepAdjustments - a consumer that will call methods on StepAdjustment.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • metricAggregationType

      ScalingPolicy.Builder metricAggregationType(String metricAggregationType)

      The aggregation type for the CloudWatch metrics. The valid values are Minimum, Maximum, and Average.

      Parameters:
      metricAggregationType - The aggregation type for the CloudWatch metrics. The valid values are Minimum, Maximum, and Average.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • estimatedInstanceWarmup

      ScalingPolicy.Builder estimatedInstanceWarmup(Integer estimatedInstanceWarmup)

      The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics.

      Parameters:
      estimatedInstanceWarmup - The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • alarms

      The CloudWatch alarms related to the policy.

      Parameters:
      alarms - The CloudWatch alarms related to the policy.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • alarms

      ScalingPolicy.Builder alarms(Alarm... alarms)

      The CloudWatch alarms related to the policy.

      Parameters:
      alarms - The CloudWatch alarms related to the policy.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • alarms

      The CloudWatch alarms related to the policy.

      This is a convenience method that creates an instance of the Alarm.Builder avoiding the need to create one manually via Alarm.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to alarms(List<Alarm>).

      Parameters:
      alarms - a consumer that will call methods on Alarm.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • targetTrackingConfiguration

      ScalingPolicy.Builder targetTrackingConfiguration(TargetTrackingConfiguration targetTrackingConfiguration)

      A target tracking scaling policy.

      Parameters:
      targetTrackingConfiguration - A target tracking scaling policy.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • targetTrackingConfiguration

      default ScalingPolicy.Builder targetTrackingConfiguration(Consumer<TargetTrackingConfiguration.Builder> targetTrackingConfiguration)

      A target tracking scaling policy.

      This is a convenience method that creates an instance of the TargetTrackingConfiguration.Builder avoiding the need to create one manually via TargetTrackingConfiguration.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to targetTrackingConfiguration(TargetTrackingConfiguration).

      Parameters:
      targetTrackingConfiguration - a consumer that will call methods on TargetTrackingConfiguration.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • enabled

      ScalingPolicy.Builder enabled(Boolean enabled)

      Indicates whether the policy is enabled (true) or disabled (false).

      Parameters:
      enabled - Indicates whether the policy is enabled (true) or disabled (false).
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • predictiveScalingConfiguration

      ScalingPolicy.Builder predictiveScalingConfiguration(PredictiveScalingConfiguration predictiveScalingConfiguration)

      A predictive scaling policy.

      Parameters:
      predictiveScalingConfiguration - A predictive scaling policy.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • predictiveScalingConfiguration

      default ScalingPolicy.Builder predictiveScalingConfiguration(Consumer<PredictiveScalingConfiguration.Builder> predictiveScalingConfiguration)

      A predictive scaling policy.

      This is a convenience method that creates an instance of the PredictiveScalingConfiguration.Builder avoiding the need to create one manually via PredictiveScalingConfiguration.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to predictiveScalingConfiguration(PredictiveScalingConfiguration).

      Parameters:
      predictiveScalingConfiguration - a consumer that will call methods on PredictiveScalingConfiguration.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also: