Terminate Instances operation
The Terminate Instances operation enables you to shut down one or more Amazon EC2 instances.
If you invoke the Terminate Instances operation for an instance more than once, the operation still executes successfully.
The following figure shows a sample <items> XML element for the Terminate Instances operation.
Sample <items> XML element for the Terminate Instances operation
<item>
<parameters>
<instances-set>
<!--Zero or more repetitions:-->
<item>
<instance-id></instance-id>
</item>
</instances-set>
</parameters>
</item>
</items>
The following table describes the elements for this adapter request.
Adapter request elements for the Terminate Instances operation
Element | Definition | Required |
---|---|---|
<wsdl-location> | Specifies the target Web Service Description Language (WSDL) URL for Amazon EC2 | Conditional:
|
<endpoint-address> | Specifies the web service endpoint for the adapter to use while performing operations on Amazon EC2 instances across different regions | No |
<signature-properties> | Specifies the mode for signing the adapter request | Conditional:
|
<operation-name> | Specifies the name of the operation: terminate-instances | Yes |
<instance-set> | Contains one or more instance IDs corresponding to the instances that you want to terminate | Yes |
The following figure shows a sample adapter request for the Terminate Instances operation.
Sample adapter request for the Terminate Instances operation
<wsdl-location>http://ec2.amazonaws.com/doc/2009-11-30/</wsdl-location>
<endpoint-address>http://us-east-1.ec2.amazonaws.com/</endpoint-address>
<signature-properties mode = "key-files">
<private-key-file>C:\Security\
pk-MJ5GIUNLM2XJ3VRJSYTKOFDWILELDQHB.PEM</private-key-file>
<certificate-file>C:\Security\
cert-MJ5GIUNLM2XJ3VRJSYTKOFDWILELDQHB.PEM</certificate-file>
</signature-properties>
<operation-name>terminate-instances</operation-name>
<parameters>
<instances-set>
<item>
<instance-id>i-bd90bfd5</instance-id>
</item>
</instances-set>
</parameters>
</amazon-ec2-request>
The following figure shows the response for the sample Terminate Instances operation.
Sample adapter response for the Terminate Instances operation
<metadata>
<status>success</status>
</metadata>
<TerminateInstancesResponse>
<requestId>8ed75e81-51bb-4dd3-9893-6e95411c8a23</requestId>
<instancesSet>
<item>
<instanceId>i-bd90bfd5</instanceId>
<currentState>
<code>32</code>
<name>shutting-down</name>
</currentState>
<previousState>
<code>16</code>
<name>running</name>
</previousState>
</item>
</instancesSet>
</TerminateInstancesResponse>
</amazon-ec2-response>