You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::AutoScaling::ScalingPolicy

Inherits:
Resources::Resource show all
Defined in:
(unknown)

Instance Attribute Summary collapse

Attributes inherited from Resources::Resource

#client, #identifiers

Instance Method Summary collapse

Methods inherited from Resources::Resource

add_data_attribute, add_identifier, #data, data_attributes, #data_loaded?, identifiers, #load, #wait_until

Methods included from Resources::OperationMethods

#add_batch_operation, #add_operation, #batch_operation, #batch_operation_names, #batch_operations, #operation, #operation_names, #operations

Constructor Details

#initialize(name, options = {}) ⇒ Object #initialize(options = {}) ⇒ Object

Overloads:

  • #initialize(name, options = {}) ⇒ Object

    Parameters:

    • name (String)

    Options Hash (options):

    • :client (Client)

      When `:client is not given, the options hash is used to construct a new Client object.

  • #initialize(options = {}) ⇒ Object

    Options Hash (options):

    • :name (required, String)
    • :client (Client)

      When `:client is not given, the options hash is used to construct a new Client object.

Instance Attribute Details

#adjustment_typeString (readonly)

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

Returns:

  • (String)

    The adjustment type, which specifies how ScalingAdjustment is interpreted.

#alarmsArray<Types::Alarm> (readonly)

The CloudWatch alarms related to the policy.

Returns:

  • (Array<Types::Alarm>)

    The CloudWatch alarms related to the policy.

#auto_scaling_group_nameString (readonly)

The name of the Auto Scaling group associated with this scaling policy.

Returns:

  • (String)

    The name of the Auto Scaling group associated with this scaling policy.

#cooldownInteger (readonly)

The amount of time, in seconds, after a scaling activity completes before any further dynamic scaling activities can start.

Returns:

  • (Integer)

    The amount of time, in seconds, after a scaling activity completes before any further dynamic scaling activities can start.

#estimated_instance_warmupInteger (readonly)

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

Returns:

  • (Integer)

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

#metric_aggregation_typeString (readonly)

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

Returns:

  • (String)

    The aggregation type for the CloudWatch metrics.

#min_adjustment_magnitudeInteger (readonly)

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:

  • (Integer)

    The minimum number of instances to scale.

#min_adjustment_stepInteger (readonly)

Available for backward compatibility. Use MinAdjustmentMagnitude instead.

Returns:

  • (Integer)

    Available for backward compatibility.

#nameString (readonly)

Returns:

  • (String)

#policy_arnString (readonly)

The Amazon Resource Name (ARN) of the policy.

Returns:

  • (String)

    The Amazon Resource Name (ARN) of the policy.

#policy_nameString (readonly)

The name of the scaling policy.

Returns:

  • (String)

    The name of the scaling policy.

#policy_typeString (readonly)

The policy type. Valid values are SimpleScaling and StepScaling.

Returns:

  • (String)

    The policy type.

#scaling_adjustmentInteger (readonly)

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:

  • (Integer)

    The amount by which to scale, based on the specified adjustment type.

#step_adjustmentsArray<Types::StepAdjustment> (readonly)

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

Returns:

  • (Array<Types::StepAdjustment>)

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

#target_tracking_configurationTypes::TargetTrackingConfiguration (readonly)

A target tracking policy.

Returns:

Instance Method Details

#delete(options = {}) ⇒ Struct

Deletes the specified Auto Scaling policy.

Deleting a policy deletes the underlying alarm action, but does not delete the alarm, even if it no longer has an associated action.

Examples:

Request syntax example with placeholder values


scalingpolicy.delete({
  auto_scaling_group_name: "ResourceName",
})

Options Hash (options):

  • :auto_scaling_group_name (String)

    The name of the Auto Scaling group.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#execute(options = {}) ⇒ Struct

Executes the specified policy.

Examples:

Request syntax example with placeholder values


scalingpolicy.execute({
  auto_scaling_group_name: "ResourceName",
  honor_cooldown: false,
  metric_value: 1.0,
  breach_threshold: 1.0,
})

Options Hash (options):

  • :auto_scaling_group_name (String)

    The name or Amazon Resource Name (ARN) of the Auto Scaling group.

  • :honor_cooldown (Boolean)

    If this parameter is true, Auto Scaling waits for the cooldown period to complete before executing the policy. Otherwise, Auto Scaling executes the policy without waiting for the cooldown period to complete.

    This parameter is not supported if the policy type is StepScaling.

    For more information, see Auto Scaling Cooldowns in the Auto Scaling User Guide.

  • :metric_value (Float)

    The metric value to compare to BreachThreshold. This enables you to execute a policy of type StepScaling and determine which step adjustment to use. For example, if the breach threshold is 50 and you want to use a step adjustment with a lower bound of 0 and an upper bound of 10, you can set the metric value to 59.

    If you specify a metric value that doesn\'t correspond to a step adjustment for the policy, the call returns an error.

    This parameter is required if the policy type is StepScaling and not supported otherwise.

  • :breach_threshold (Float)

    The breach threshold for the alarm.

    This parameter is required if the policy type is StepScaling and not supported otherwise.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#groupAutoScalingGroup?

Returns: