Class ScalingPolicy

    • Constructor Detail

      • ScalingPolicy

        public ScalingPolicy()
    • Method Detail

      • setAutoScalingGroupName

        public void setAutoScalingGroupName​(String autoScalingGroupName)

        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

        public String 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

        public ScalingPolicy withAutoScalingGroupName​(String autoScalingGroupName)

        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

        public void setPolicyName​(String policyName)

        The name of the scaling policy.

        Parameters:
        policyName - The name of the scaling policy.
      • getPolicyName

        public String getPolicyName()

        The name of the scaling policy.

        Returns:
        The name of the scaling policy.
      • withPolicyName

        public ScalingPolicy withPolicyName​(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.
      • setPolicyARN

        public void setPolicyARN​(String policyARN)

        The Amazon Resource Name (ARN) of the policy.

        Parameters:
        policyARN - The Amazon Resource Name (ARN) of the policy.
      • getPolicyARN

        public String getPolicyARN()

        The Amazon Resource Name (ARN) of the policy.

        Returns:
        The Amazon Resource Name (ARN) of the policy.
      • withPolicyARN

        public ScalingPolicy withPolicyARN​(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.
      • setPolicyType

        public void setPolicyType​(String policyType)

        The policy type. Valid values are SimpleScaling and StepScaling.

        Parameters:
        policyType - The policy type. Valid values are SimpleScaling and StepScaling.
      • getPolicyType

        public String getPolicyType()

        The policy type. Valid values are SimpleScaling and StepScaling.

        Returns:
        The policy type. Valid values are SimpleScaling and StepScaling.
      • withPolicyType

        public ScalingPolicy withPolicyType​(String policyType)

        The policy type. Valid values are SimpleScaling and StepScaling.

        Parameters:
        policyType - The policy type. Valid values are SimpleScaling and StepScaling.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • setAdjustmentType

        public void setAdjustmentType​(String adjustmentType)

        The adjustment type, which specifies how ScalingAdjustment is interpreted. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

        Parameters:
        adjustmentType - The adjustment type, which specifies how ScalingAdjustment is interpreted. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.
      • getAdjustmentType

        public String getAdjustmentType()

        The adjustment type, which specifies how ScalingAdjustment is interpreted. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

        Returns:
        The adjustment type, which specifies how ScalingAdjustment is interpreted. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.
      • withAdjustmentType

        public ScalingPolicy withAdjustmentType​(String adjustmentType)

        The adjustment type, which specifies how ScalingAdjustment is interpreted. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

        Parameters:
        adjustmentType - The adjustment type, which specifies how ScalingAdjustment is interpreted. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • setMinAdjustmentStep

        public void setMinAdjustmentStep​(Integer minAdjustmentStep)

        Available for backward compatibility. Use MinAdjustmentMagnitude instead.

        Parameters:
        minAdjustmentStep - Available for backward compatibility. Use MinAdjustmentMagnitude instead.
      • getMinAdjustmentStep

        public Integer getMinAdjustmentStep()

        Available for backward compatibility. Use MinAdjustmentMagnitude instead.

        Returns:
        Available for backward compatibility. Use MinAdjustmentMagnitude instead.
      • withMinAdjustmentStep

        public ScalingPolicy withMinAdjustmentStep​(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.
      • setMinAdjustmentMagnitude

        public void setMinAdjustmentMagnitude​(Integer minAdjustmentMagnitude)

        The minimum number of instances to scale. If the value of AdjustmentType is PercentChangeInCapacity, the scaling policy changes the DesiredCapacity of the Auto Scaling group by at least this many instances. Otherwise, the error is ValidationError.

        Parameters:
        minAdjustmentMagnitude - The minimum number of instances to scale. If the value of AdjustmentType is PercentChangeInCapacity, the scaling policy changes the DesiredCapacity of the Auto Scaling group by at least this many instances. Otherwise, the error is ValidationError.
      • getMinAdjustmentMagnitude

        public Integer getMinAdjustmentMagnitude()

        The minimum number of instances to scale. If the value of AdjustmentType is PercentChangeInCapacity, the scaling policy changes the DesiredCapacity of the Auto Scaling group by at least this many instances. Otherwise, the error is ValidationError.

        Returns:
        The minimum number of instances to scale. If the value of AdjustmentType is PercentChangeInCapacity, the scaling policy changes the DesiredCapacity of the Auto Scaling group by at least this many instances. Otherwise, the error is ValidationError.
      • withMinAdjustmentMagnitude

        public ScalingPolicy withMinAdjustmentMagnitude​(Integer minAdjustmentMagnitude)

        The minimum number of instances to scale. If the value of AdjustmentType is PercentChangeInCapacity, the scaling policy changes the DesiredCapacity of the Auto Scaling group by at least this many instances. Otherwise, the error is ValidationError.

        Parameters:
        minAdjustmentMagnitude - The minimum number of instances to scale. If the value of AdjustmentType is PercentChangeInCapacity, the scaling policy changes the DesiredCapacity of the Auto Scaling group by at least this many instances. Otherwise, the error is ValidationError.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • setScalingAdjustment

        public void setScalingAdjustment​(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.
      • getScalingAdjustment

        public Integer 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

        public ScalingPolicy withScalingAdjustment​(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.
      • setCooldown

        public void setCooldown​(Integer cooldown)

        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

        public Integer 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

        public ScalingPolicy withCooldown​(Integer cooldown)

        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

        public List<StepAdjustment> 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

        public void setStepAdjustments​(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.
      • withStepAdjustments

        public ScalingPolicy withStepAdjustments​(StepAdjustment... stepAdjustments)

        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) or withStepAdjustments(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

        public ScalingPolicy withStepAdjustments​(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.
      • setMetricAggregationType

        public void setMetricAggregationType​(String metricAggregationType)

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

        Parameters:
        metricAggregationType - The aggregation type for the CloudWatch metrics. Valid values are Minimum, Maximum, and Average.
      • getMetricAggregationType

        public String getMetricAggregationType()

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

        Returns:
        The aggregation type for the CloudWatch metrics. Valid values are Minimum, Maximum, and Average.
      • withMetricAggregationType

        public ScalingPolicy withMetricAggregationType​(String metricAggregationType)

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

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

        public void setEstimatedInstanceWarmup​(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.
      • getEstimatedInstanceWarmup

        public Integer 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

        public ScalingPolicy withEstimatedInstanceWarmup​(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.
      • getAlarms

        public List<Alarm> getAlarms()

        The CloudWatch alarms related to the policy.

        Returns:
        The CloudWatch alarms related to the policy.
      • setAlarms

        public void setAlarms​(Collection<Alarm> alarms)

        The CloudWatch alarms related to the policy.

        Parameters:
        alarms - The CloudWatch alarms related to the policy.
      • withAlarms

        public ScalingPolicy withAlarms​(Alarm... alarms)

        The CloudWatch alarms related to the policy.

        NOTE: This method appends the values to the existing list (if any). Use setAlarms(java.util.Collection) or withAlarms(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

        public ScalingPolicy withAlarms​(Collection<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.
      • toString

        public String toString()
        Returns a string representation of this object; useful for testing and debugging.
        Overrides:
        toString in class Object
        Returns:
        A string representation of this object.
        See Also:
        Object.toString()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object