@attr_reader [String] arn
@attr_reader [String] adjustment_type
@attr_reader [Integer] scaling_adjustment
@attr_reader [Hash] alarms Returns a hash of alarms names (keys)
to alarm ARNs (values).
@attr_reader [Integer] cooldown
@attr_reader [Integer] min_adjustment_magnitude
@return [Group]
@return [Group]
@return [String]
@private
# File lib/aws/auto_scaling/scaling_policy.rb, line 36 def initialize auto_scaling_group, policy_name, options = {} @group = auto_scaling_group @name = policy_name super end
Deletes this scaling policy. @return [nil]
# File lib/aws/auto_scaling/scaling_policy.rb, line 110 def delete client_opts = {} client_opts[:auto_scaling_group_name] = group.name client_opts[:policy_name] = name client.delete_policy(client_opts) nil end
Runs this policy against it's Auto Scaling group.
@param [Hash] options
@option options [Boolean] :honor_cooldown (false) Set to true if you
want Auto Scaling to reject this request when the Auto Scaling group is in cooldown.
@raise [Errors::ScalingActivityInProgress]
@return [nil]
# File lib/aws/auto_scaling/scaling_policy.rb, line 99 def execute options = {} client_opts = {} client_opts[:auto_scaling_group_name] = group.name client_opts[:policy_name] = name client_opts[:honor_cooldown] = options[:honor_cooldown] == true client.execute_policy(client_opts) nil end
@return [Boolean] Returns true if the policy exists.
# File lib/aws/auto_scaling/scaling_policy.rb, line 119 def exists? client_opts = {} client_opts[:auto_scaling_group_name] = group.name client_opts[:policy_names] = [name] resp = client.describe_policies(client_opts) !resp.scaling_policies.empty? end
Updates this scaling policy. @param (see AWS::AutoScaling::ScalingPolicyOptions#scaling_policy_options) @option (see AWS::AutoScaling::ScalingPolicyOptions#scaling_policy_options) @return [nil]
# File lib/aws/auto_scaling/scaling_policy.rb, line 79 def update options = {} client_opts = scaling_policy_options(group, name, options) resp = client.put_scaling_policy(client_opts) static_attributes[:arn] = resp.policy_arn nil end
# File lib/aws/auto_scaling/scaling_policy.rb, line 129 def get_resource attr_name = nil client_opts = {} client_opts[:auto_scaling_group_name] = group.name client_opts[:policy_names] = [name] client.describe_policies(client_opts) end
# File lib/aws/auto_scaling/scaling_policy.rb, line 136 def resource_identifiers [[:group, group], [:name, name]] end