ec2-cancel-spot-instance-requests

Description

Cancels one or more Spot Instance requests. Spot Instances are instances that Amazon EC2 starts on your behalf when the maximum price that you specify exceeds the current Spot Price. Amazon EC2 periodically sets the Spot Price based on available Spot Instance capacity and current spot instance requests. For conceptual information about Spot Instances, refer to the Amazon Elastic Compute Cloud Developer Guide or Amazon Elastic Compute Cloud User Guide.

[Important]Important

Canceling a Spot Instance request does not terminiate running Spot Instances associated with the request.

Syntax

ec2-cancel-spot-instance-requests request_id [request_id...]

Options

NameDescriptionRequired

request_id

Specifies the ID of the Spot Instance request.

Type: String

Default: None

Example: sir-8456a32b

Yes

Output

The command returns a table that contains the following information:

  • Request ID

  • Spot Instance requests

  • State

Amazon EC2 displays errors on stderr.

Examples

Example Request

This example cancels a Spot Instance request.

PROMPT> ec2-cancel-spot-instance-requests sir-ed3a2006
SPOTINSTANCEREQUEST sir-ed3a2006 cancelled