CancelSpotFleetRequests - Amazon Elastic Compute Cloud
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.


Cancels the specified Spot Fleet requests.

After you cancel a Spot Fleet request, the Spot Fleet launches no new Spot Instances. You must specify whether the Spot Fleet should also terminate its Spot Instances. If you terminate the instances, the Spot Fleet request enters the cancelled_terminating state. Otherwise, the Spot Fleet request enters the cancelled_running state and the instances continue to run until they are interrupted or you terminate them manually.

Request Parameters

The following parameters are for this specific action. For more information about required and optional parameters that are common to all actions, see Common Query Parameters.


Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Type: Boolean

Required: No


The IDs of the Spot Fleet requests.

Type: Array of strings

Required: Yes


Indicates whether to terminate instances for a Spot Fleet request if it is canceled successfully.

Type: Boolean

Required: Yes

Response Elements

The following elements are returned by the service.


The ID of the request.

Type: String


Information about the Spot Fleet requests that are successfully canceled.

Type: Array of CancelSpotFleetRequestsSuccessItem objects


Information about the Spot Fleet requests that are not successfully canceled.

Type: Array of CancelSpotFleetRequestsErrorItem objects


For information about the errors that are common to all actions, see Common client error codes.



This example cancels Spot Fleet request sfr-123f8fc2-cb31-425e-abcd-example2710 and terminates all instances that were launched by the request.

Sample Request &SpotFleetRequestId.1=sfr-123f8fc2-cb31-425e-abcd-example2710 &TerminateInstances=true &AUTHPARAMS

Sample Response

<CancelSpotFleetRequestsResponse xmlns=""> <requestId>e12d2fe5-6503-4b4b-911c-example</requestId> <unsuccessfulFleetRequestSet/> <successfulFleetRequestSet> <item> <spotFleetRequestId>sfr-123f8fc2-cb31-425e-abcd-example2710</spotFleetRequestId> <currentSpotFleetRequestState>cancelled_terminating</currentSpotFleetRequestState> <previousSpotFleetRequestState>active</previousSpotFleetRequestState> </item> </successfulFleetRequestSet> </CancelSpotFleetRequestsResponse>