Method: AWS::AutoScaling::Instance#terminate

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

#terminate(decrement_desired_capacity) ⇒ Activity Also known as: delete

Terminates the current Auto Scaling instance.

Parameters:

  • decrement_desired_capacity (Boolean)

    Specifies whether or not terminating this instance should also decrement the size of the AutoScalingGroup.

Returns:

  • (Activity)

    Returns an activity that represents the termination of the instance.



160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/aws/auto_scaling/instance.rb', line 160

def terminate decrement_desired_capacity

  client_opts = {}
  client_opts[:instance_id] = instance_id
  client_opts[:should_decrement_desired_capacity] = 
    decrement_desired_capacity

  resp = client.terminate_instance_in_auto_scaling_group(client_opts)

  Activity.new_from(
    :terminate_instance_in_auto_scaling_group,
    resp.activity, 
    resp.activity.activity_id, 
    :config => config)

end