The TerminateInstances operation shuts down one or more instances. This operation is idempotent; if you terminate an instance more than once, each call will succeed.
Terminated instances will remain visible after termination (approximately one hour).
Access
public
Parameters
Parameter |
Type |
Required |
Description |
---|---|---|---|
|
Required |
The list of instances to terminate. Pass a string for a single value, or an indexed array for multiple values. |
|
|
Optional |
An associative array of parameters that can have the following keys:
|
Returns
Type |
Description |
---|---|
A |
Examples
Terminate an instance in the VPC subnet
// Instantiate the class $ec2 = new AmazonEC2(); // Terminate instances $response = $ec2->terminate_instances($instance_id); // Success? var_dump($response->isOK());Result:
bool(true)
Terminate an instance.
// Instantiate the class $ec2 = new AmazonEC2(); // Terminate instances $response = $ec2->terminate_instances('i-1f549375'); // Success? var_dump($response->isOK());Result:
bool(true)
Related Methods
Source
Method defined in services/ec2.class.php | Toggle source view (11 lines) | View on GitHub