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
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.
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
The IDs of the Spot fleet requests.
Type: array of Strings
Indicates whether to terminate instances for a Spot fleet request if it is canceled successfully.
The following elements are returned by the service.
The ID of the request.
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 Errors.
This example cancels Spot fleet request sfr-123f8fc2-cb31-425e-abcd-example2710 and terminates all instances that were launched by the request.
https://ec2.amazonaws.com/?Action=CancelSpotFleetRequests &SpotFleetRequestId.1=sfr-123f8fc2-cb31-425e-abcd-example2710 &TerminateInstances=true &AUTHPARAMS
<CancelSpotFleetRequestsResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/"> <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>
For more information about using this API in one of the language-specific AWS SDKs, see the following: