Class ScalingPolicy
- All Implemented Interfaces:
Serializable
,Cloneable
Describes a scaling policy.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
The adjustment type, which specifies howScalingAdjustment
is interpreted.The CloudWatch alarms related to the policy.The name of the Auto Scaling group associated with this scaling policy.The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start.The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics.The aggregation type for the CloudWatch metrics.The minimum number of instances to scale.Available for backward compatibility.The Amazon Resource Name (ARN) of the policy.The name of the scaling policy.The policy type.The amount by which to scale, based on the specified adjustment type.A set of adjustments that enable you to scale based on the size of the alarm breach.int
hashCode()
void
setAdjustmentType
(String adjustmentType) The adjustment type, which specifies howScalingAdjustment
is interpreted.void
setAlarms
(Collection<Alarm> alarms) The CloudWatch alarms related to the policy.void
setAutoScalingGroupName
(String autoScalingGroupName) The name of the Auto Scaling group associated with this scaling policy.void
setCooldown
(Integer cooldown) The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start.void
setEstimatedInstanceWarmup
(Integer estimatedInstanceWarmup) The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics.void
setMetricAggregationType
(String metricAggregationType) The aggregation type for the CloudWatch metrics.void
setMinAdjustmentMagnitude
(Integer minAdjustmentMagnitude) The minimum number of instances to scale.void
setMinAdjustmentStep
(Integer minAdjustmentStep) Available for backward compatibility.void
setPolicyARN
(String policyARN) The Amazon Resource Name (ARN) of the policy.void
setPolicyName
(String policyName) The name of the scaling policy.void
setPolicyType
(String policyType) The policy type.void
setScalingAdjustment
(Integer scalingAdjustment) The amount by which to scale, based on the specified adjustment type.void
setStepAdjustments
(Collection<StepAdjustment> stepAdjustments) A set of adjustments that enable you to scale based on the size of the alarm breach.toString()
Returns a string representation of this object; useful for testing and debugging.withAdjustmentType
(String adjustmentType) The adjustment type, which specifies howScalingAdjustment
is interpreted.withAlarms
(Alarm... alarms) The CloudWatch alarms related to the policy.withAlarms
(Collection<Alarm> alarms) The CloudWatch alarms related to the policy.withAutoScalingGroupName
(String autoScalingGroupName) The name of the Auto Scaling group associated with this scaling policy.withCooldown
(Integer cooldown) The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start.withEstimatedInstanceWarmup
(Integer estimatedInstanceWarmup) The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics.withMetricAggregationType
(String metricAggregationType) The aggregation type for the CloudWatch metrics.withMinAdjustmentMagnitude
(Integer minAdjustmentMagnitude) The minimum number of instances to scale.withMinAdjustmentStep
(Integer minAdjustmentStep) Available for backward compatibility.withPolicyARN
(String policyARN) The Amazon Resource Name (ARN) of the policy.withPolicyName
(String policyName) The name of the scaling policy.withPolicyType
(String policyType) The policy type.withScalingAdjustment
(Integer scalingAdjustment) The amount by which to scale, based on the specified adjustment type.withStepAdjustments
(StepAdjustment... stepAdjustments) A set of adjustments that enable you to scale based on the size of the alarm breach.withStepAdjustments
(Collection<StepAdjustment> stepAdjustments) A set of adjustments that enable you to scale based on the size of the alarm breach.
-
Constructor Details
-
ScalingPolicy
public ScalingPolicy()
-
-
Method Details
-
setAutoScalingGroupName
The name of the Auto Scaling group associated with this scaling policy.
- Parameters:
autoScalingGroupName
- The name of the Auto Scaling group associated with this scaling policy.
-
getAutoScalingGroupName
The name of the Auto Scaling group associated with this scaling policy.
- Returns:
- The name of the Auto Scaling group associated with this scaling policy.
-
withAutoScalingGroupName
The name of the Auto Scaling group associated with this scaling policy.
- Parameters:
autoScalingGroupName
- The name of the Auto Scaling group associated with this scaling policy.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setPolicyName
The name of the scaling policy.
- Parameters:
policyName
- The name of the scaling policy.
-
getPolicyName
The name of the scaling policy.
- Returns:
- The name of the scaling policy.
-
withPolicyName
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.
-
setPolicyARN
The Amazon Resource Name (ARN) of the policy.
- Parameters:
policyARN
- The Amazon Resource Name (ARN) of the policy.
-
getPolicyARN
The Amazon Resource Name (ARN) of the policy.
- Returns:
- The Amazon Resource Name (ARN) of the policy.
-
withPolicyARN
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.
-
setPolicyType
The policy type. Valid values are
SimpleScaling
andStepScaling
.- Parameters:
policyType
- The policy type. Valid values areSimpleScaling
andStepScaling
.
-
getPolicyType
The policy type. Valid values are
SimpleScaling
andStepScaling
.- Returns:
- The policy type. Valid values are
SimpleScaling
andStepScaling
.
-
withPolicyType
The policy type. Valid values are
SimpleScaling
andStepScaling
.- Parameters:
policyType
- The policy type. Valid values areSimpleScaling
andStepScaling
.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setAdjustmentType
The adjustment type, which specifies how
ScalingAdjustment
is interpreted. Valid values areChangeInCapacity
,ExactCapacity
, andPercentChangeInCapacity
.- Parameters:
adjustmentType
- The adjustment type, which specifies howScalingAdjustment
is interpreted. Valid values areChangeInCapacity
,ExactCapacity
, andPercentChangeInCapacity
.
-
getAdjustmentType
The adjustment type, which specifies how
ScalingAdjustment
is interpreted. Valid values areChangeInCapacity
,ExactCapacity
, andPercentChangeInCapacity
.- Returns:
- The adjustment type, which specifies how
ScalingAdjustment
is interpreted. Valid values areChangeInCapacity
,ExactCapacity
, andPercentChangeInCapacity
.
-
withAdjustmentType
The adjustment type, which specifies how
ScalingAdjustment
is interpreted. Valid values areChangeInCapacity
,ExactCapacity
, andPercentChangeInCapacity
.- Parameters:
adjustmentType
- The adjustment type, which specifies howScalingAdjustment
is interpreted. Valid values areChangeInCapacity
,ExactCapacity
, andPercentChangeInCapacity
.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setMinAdjustmentStep
Available for backward compatibility. Use
MinAdjustmentMagnitude
instead.- Parameters:
minAdjustmentStep
- Available for backward compatibility. UseMinAdjustmentMagnitude
instead.
-
getMinAdjustmentStep
Available for backward compatibility. Use
MinAdjustmentMagnitude
instead.- Returns:
- Available for backward compatibility. Use
MinAdjustmentMagnitude
instead.
-
withMinAdjustmentStep
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.
-
setMinAdjustmentMagnitude
The minimum number of instances to scale. If the value of
AdjustmentType
isPercentChangeInCapacity
, the scaling policy changes theDesiredCapacity
of the Auto Scaling group by at least this many instances. Otherwise, the error isValidationError
.- Parameters:
minAdjustmentMagnitude
- The minimum number of instances to scale. If the value ofAdjustmentType
isPercentChangeInCapacity
, the scaling policy changes theDesiredCapacity
of the Auto Scaling group by at least this many instances. Otherwise, the error isValidationError
.
-
getMinAdjustmentMagnitude
The minimum number of instances to scale. If the value of
AdjustmentType
isPercentChangeInCapacity
, the scaling policy changes theDesiredCapacity
of the Auto Scaling group by at least this many instances. Otherwise, the error isValidationError
.- Returns:
- The minimum number of instances to scale. If the value of
AdjustmentType
isPercentChangeInCapacity
, the scaling policy changes theDesiredCapacity
of the Auto Scaling group by at least this many instances. Otherwise, the error isValidationError
.
-
withMinAdjustmentMagnitude
The minimum number of instances to scale. If the value of
AdjustmentType
isPercentChangeInCapacity
, the scaling policy changes theDesiredCapacity
of the Auto Scaling group by at least this many instances. Otherwise, the error isValidationError
.- Parameters:
minAdjustmentMagnitude
- The minimum number of instances to scale. If the value ofAdjustmentType
isPercentChangeInCapacity
, the scaling policy changes theDesiredCapacity
of the Auto Scaling group by at least this many instances. Otherwise, the error isValidationError
.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setScalingAdjustment
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.
-
getScalingAdjustment
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:
- 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.
-
withScalingAdjustment
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.
-
setCooldown
The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start.
- Parameters:
cooldown
- The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start.
-
getCooldown
The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start.
- Returns:
- The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start.
-
withCooldown
The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start.
- Parameters:
cooldown
- The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
getStepAdjustments
A set of adjustments that enable you to scale based on the size of the alarm breach.
- Returns:
- A set of adjustments that enable you to scale based on the size of the alarm breach.
-
setStepAdjustments
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.
-
withStepAdjustments
A set of adjustments that enable you to scale based on the size of the alarm breach.
NOTE: This method appends the values to the existing list (if any). Use
setStepAdjustments(java.util.Collection)
orwithStepAdjustments(java.util.Collection)
if you want to override the existing values.- 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.
-
withStepAdjustments
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.
-
setMetricAggregationType
The aggregation type for the CloudWatch metrics. Valid values are
Minimum
,Maximum
, andAverage
.- Parameters:
metricAggregationType
- The aggregation type for the CloudWatch metrics. Valid values areMinimum
,Maximum
, andAverage
.
-
getMetricAggregationType
The aggregation type for the CloudWatch metrics. Valid values are
Minimum
,Maximum
, andAverage
.- Returns:
- The aggregation type for the CloudWatch metrics. Valid values are
Minimum
,Maximum
, andAverage
.
-
withMetricAggregationType
The aggregation type for the CloudWatch metrics. Valid values are
Minimum
,Maximum
, andAverage
.- Parameters:
metricAggregationType
- The aggregation type for the CloudWatch metrics. Valid values areMinimum
,Maximum
, andAverage
.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setEstimatedInstanceWarmup
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.
-
getEstimatedInstanceWarmup
The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics.
- Returns:
- The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics.
-
withEstimatedInstanceWarmup
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.
-
getAlarms
The CloudWatch alarms related to the policy.
- Returns:
- The CloudWatch alarms related to the policy.
-
setAlarms
The CloudWatch alarms related to the policy.
- Parameters:
alarms
- The CloudWatch alarms related to the policy.
-
withAlarms
The CloudWatch alarms related to the policy.
NOTE: This method appends the values to the existing list (if any). Use
setAlarms(java.util.Collection)
orwithAlarms(java.util.Collection)
if you want to override the existing values.- Parameters:
alarms
- The CloudWatch alarms related to the policy.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withAlarms
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.
-
toString
Returns a string representation of this object; useful for testing and debugging. -
equals
-
hashCode
public int hashCode() -
clone
-