terminate_instance_in_auto_scaling_group ( $instance_id, $should_decrement_desired_capacity, $opt )

Terminates the specified instance. Optionally, the desired group size can be adjusted.

This call simply registers a termination request. The termination of the instance cannot happen immediately.

Access

public

Parameters

Parameter

Type

Required

Description

$instance_id

string

Required

The ID of the Amazon EC2 instance to be terminated. [Constraints: The value must be between 1 and 16 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]

$should_decrement_desired_capacity

boolean

Required

Specifies whether (true) or not (false) terminating this instance should also decrement the size of the AutoScalingGroup.

$opt

array

Optional

An associative array of parameters that can have the following keys:

  • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
  • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.

Returns

Type

Description

CFResponse

A CFResponse object containing a parsed HTTP response.

Examples

Terminates the specified instance. Optionally, the desired group size can be adjusted.

// Instantiate the class
$as = new AmazonAS();

$response = $as->terminate_instance_in_auto_scaling_group('i-be038dd3', 'false');

// Success?
var_dump($response->isOK());
Result:
bool(true)

Related Methods

Source

Method defined in services/as.class.php | Toggle source view (8 lines) | View on GitHub

public function terminate_instance_in_auto_scaling_group($instance_id, $should_decrement_desired_capacity, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['InstanceId'] = $instance_id;
    $opt['ShouldDecrementDesiredCapacity'] = $should_decrement_desired_capacity;
    
    return $this->authenticate('TerminateInstanceInAutoScalingGroup', $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback