Interface ScalingPolicy.Builder
- All Superinterfaces:
Buildable
,CopyableBuilder<ScalingPolicy.Builder,
,ScalingPolicy> SdkBuilder<ScalingPolicy.Builder,
,ScalingPolicy> SdkPojo
- Enclosing class:
ScalingPolicy
-
Method Summary
Modifier and TypeMethodDescriptionadjustmentType
(String adjustmentType) Specifies how the scaling adjustment is interpreted (for example, an absolute number or a percentage).alarms
(Collection<Alarm> alarms) The CloudWatch alarms related to the policy.alarms
(Consumer<Alarm.Builder>... alarms) The CloudWatch alarms related to the policy.The CloudWatch alarms related to the policy.autoScalingGroupName
(String autoScalingGroupName) The name of the Auto Scaling group.The duration of the policy's cooldown period, in seconds.Indicates whether the policy is enabled (true
) or disabled (false
).estimatedInstanceWarmup
(Integer estimatedInstanceWarmup) The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics.metricAggregationType
(String metricAggregationType) The aggregation type for the CloudWatch metrics.minAdjustmentMagnitude
(Integer minAdjustmentMagnitude) The minimum value to scale by when the adjustment type isPercentChangeInCapacity
.minAdjustmentStep
(Integer minAdjustmentStep) Available for backward compatibility.The Amazon Resource Name (ARN) of the policy.policyName
(String policyName) The name of the scaling policy.policyType
(String policyType) One of the following policy types:default ScalingPolicy.Builder
predictiveScalingConfiguration
(Consumer<PredictiveScalingConfiguration.Builder> predictiveScalingConfiguration) A predictive scaling policy.predictiveScalingConfiguration
(PredictiveScalingConfiguration predictiveScalingConfiguration) A predictive scaling policy.scalingAdjustment
(Integer scalingAdjustment) The amount by which to scale, based on the specified adjustment type.stepAdjustments
(Collection<StepAdjustment> stepAdjustments) A set of adjustments that enable you to scale based on the size of the alarm breach.stepAdjustments
(Consumer<StepAdjustment.Builder>... stepAdjustments) A set of adjustments that enable you to scale based on the size of the alarm breach.stepAdjustments
(StepAdjustment... stepAdjustments) A set of adjustments that enable you to scale based on the size of the alarm breach.default ScalingPolicy.Builder
targetTrackingConfiguration
(Consumer<TargetTrackingConfiguration.Builder> targetTrackingConfiguration) A target tracking scaling policy.targetTrackingConfiguration
(TargetTrackingConfiguration targetTrackingConfiguration) A target tracking scaling policy.Methods inherited from interface software.amazon.awssdk.utils.builder.CopyableBuilder
copy
Methods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation, build
Methods inherited from interface software.amazon.awssdk.core.SdkPojo
equalsBySdkFields, sdkFieldNameToField, sdkFields
-
Method Details
-
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
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
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
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
Specifies how the scaling adjustment is interpreted (for example, an absolute number or a percentage). The valid values are
ChangeInCapacity
,ExactCapacity
, andPercentChangeInCapacity
.- Parameters:
adjustmentType
- Specifies how the scaling adjustment is interpreted (for example, an absolute number or a percentage). The valid values areChangeInCapacity
,ExactCapacity
, andPercentChangeInCapacity
.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
minAdjustmentStep
Available for backward compatibility. Use
MinAdjustmentMagnitude
instead.- Parameters:
minAdjustmentStep
- Available for backward compatibility. UseMinAdjustmentMagnitude
instead.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
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 isPercentChangeInCapacity
.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
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
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
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
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
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 theStepAdjustment.Builder
avoiding the need to create one manually viaStepAdjustment.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed tostepAdjustments(List<StepAdjustment>)
.- Parameters:
stepAdjustments
- a consumer that will call methods onStepAdjustment.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
metricAggregationType
The aggregation type for the CloudWatch metrics. The valid values are
Minimum
,Maximum
, andAverage
.- Parameters:
metricAggregationType
- The aggregation type for the CloudWatch metrics. The valid values areMinimum
,Maximum
, andAverage
.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
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
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 theAlarm.Builder
avoiding the need to create one manually viaAlarm.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed toalarms(List<Alarm>)
.- Parameters:
alarms
- a consumer that will call methods onAlarm.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 theTargetTrackingConfiguration.Builder
avoiding the need to create one manually viaTargetTrackingConfiguration.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed totargetTrackingConfiguration(TargetTrackingConfiguration)
.- Parameters:
targetTrackingConfiguration
- a consumer that will call methods onTargetTrackingConfiguration.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
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 thePredictiveScalingConfiguration.Builder
avoiding the need to create one manually viaPredictiveScalingConfiguration.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed topredictiveScalingConfiguration(PredictiveScalingConfiguration)
.- Parameters:
predictiveScalingConfiguration
- a consumer that will call methods onPredictiveScalingConfiguration.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-