Method: AWS::AutoScaling::Instance#set_health

Defined in:
lib/aws/auto_scaling/instance.rb

#set_health(status, options = {}) ⇒ nil

Parameters:

  • status (String)

    Sets the health status of an instance.

    Valid values inculde ‘Healthy’ and ‘Unhealthy’

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :respect_grace_period (Boolean) — default: false

    If true, this call should respect the grace period associated with this instance’s Auto Scaling group.

Returns:

  • (nil)


136
137
138
139
140
141
142
143
# File 'lib/aws/auto_scaling/instance.rb', line 136

def set_health status, options = {}
  client_opts = {}
  client_opts[:instance_id] = instance_id
  client_opts[:health_status] = status
  client_opts[:should_respect_grace_period] = 
    options[:respect_grace_period] == true
  client.set_instance_health(client_opts)
end