Class ScalingPolicy
- All Implemented Interfaces:
Serializable, Cloneable
Describes a scaling policy.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()booleanThe adjustment type, which specifies howScalingAdjustmentis 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.inthashCode()voidsetAdjustmentType(String adjustmentType) The adjustment type, which specifies howScalingAdjustmentis interpreted.voidsetAlarms(Collection<Alarm> alarms) The CloudWatch alarms related to the policy.voidsetAutoScalingGroupName(String autoScalingGroupName) The name of the Auto Scaling group associated with this scaling policy.voidsetCooldown(Integer cooldown) The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start.voidsetEstimatedInstanceWarmup(Integer estimatedInstanceWarmup) The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics.voidsetMetricAggregationType(String metricAggregationType) The aggregation type for the CloudWatch metrics.voidsetMinAdjustmentMagnitude(Integer minAdjustmentMagnitude) The minimum number of instances to scale.voidsetMinAdjustmentStep(Integer minAdjustmentStep) Available for backward compatibility.voidsetPolicyARN(String policyARN) The Amazon Resource Name (ARN) of the policy.voidsetPolicyName(String policyName) The name of the scaling policy.voidsetPolicyType(String policyType) The policy type.voidsetScalingAdjustment(Integer scalingAdjustment) The amount by which to scale, based on the specified adjustment type.voidsetStepAdjustments(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 howScalingAdjustmentis 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
SimpleScalingandStepScaling.- Parameters:
policyType- The policy type. Valid values areSimpleScalingandStepScaling.
-
getPolicyType
The policy type. Valid values are
SimpleScalingandStepScaling.- Returns:
- The policy type. Valid values are
SimpleScalingandStepScaling.
-
withPolicyType
The policy type. Valid values are
SimpleScalingandStepScaling.- Parameters:
policyType- The policy type. Valid values areSimpleScalingandStepScaling.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setAdjustmentType
The adjustment type, which specifies how
ScalingAdjustmentis interpreted. Valid values areChangeInCapacity,ExactCapacity, andPercentChangeInCapacity.- Parameters:
adjustmentType- The adjustment type, which specifies howScalingAdjustmentis interpreted. Valid values areChangeInCapacity,ExactCapacity, andPercentChangeInCapacity.
-
getAdjustmentType
The adjustment type, which specifies how
ScalingAdjustmentis interpreted. Valid values areChangeInCapacity,ExactCapacity, andPercentChangeInCapacity.- Returns:
- The adjustment type, which specifies how
ScalingAdjustmentis interpreted. Valid values areChangeInCapacity,ExactCapacity, andPercentChangeInCapacity.
-
withAdjustmentType
The adjustment type, which specifies how
ScalingAdjustmentis interpreted. Valid values areChangeInCapacity,ExactCapacity, andPercentChangeInCapacity.- Parameters:
adjustmentType- The adjustment type, which specifies howScalingAdjustmentis 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
MinAdjustmentMagnitudeinstead.- Parameters:
minAdjustmentStep- Available for backward compatibility. UseMinAdjustmentMagnitudeinstead.
-
getMinAdjustmentStep
Available for backward compatibility. Use
MinAdjustmentMagnitudeinstead.- Returns:
- Available for backward compatibility. Use
MinAdjustmentMagnitudeinstead.
-
withMinAdjustmentStep
Available for backward compatibility. Use
MinAdjustmentMagnitudeinstead.- Parameters:
minAdjustmentStep- Available for backward compatibility. UseMinAdjustmentMagnitudeinstead.- 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
AdjustmentTypeisPercentChangeInCapacity, the scaling policy changes theDesiredCapacityof 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 ofAdjustmentTypeisPercentChangeInCapacity, the scaling policy changes theDesiredCapacityof 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
AdjustmentTypeisPercentChangeInCapacity, the scaling policy changes theDesiredCapacityof 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
AdjustmentTypeisPercentChangeInCapacity, the scaling policy changes theDesiredCapacityof 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
AdjustmentTypeisPercentChangeInCapacity, the scaling policy changes theDesiredCapacityof 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 ofAdjustmentTypeisPercentChangeInCapacity, the scaling policy changes theDesiredCapacityof 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
-
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
-
equals
-
hashCode
-
clone
-