Cancel Spot Fleet Requests
| ec2_cancel_spot_fleet_requests | R Documentation |
Cancels the specified Spot Fleet requests¶
Description¶
Cancels the specified Spot Fleet requests.
After you cancel a Spot Fleet request, the Spot Fleet launches no new instances.
You must also specify whether a canceled Spot Fleet request should
terminate its instances. If you choose to 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.
Terminating an instance is permanent and irreversible.
After you terminate an instance, you can no longer connect to it, and it can't be recovered. All attached Amazon EBS volumes that are configured to be deleted on termination are also permanently deleted and can't be recovered. All data stored on instance store volumes is permanently lost. For more information, see How instance termination works.
Before you terminate an instance, ensure that you have backed up all data that you need to retain after the termination to persistent storage.
Restrictions
- You can delete up to 100 fleets in a single request. If you exceed the specified number, no fleets are deleted.
Usage¶
ec2_cancel_spot_fleet_requests(DryRun, SpotFleetRequestIds,
TerminateInstances)
Arguments¶
DryRun |
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
|
SpotFleetRequestIds |
[required] The IDs of the Spot Fleet requests. Constraint: You can specify up to 100 IDs in a single request. |
TerminateInstances |
[required] Indicates whether to terminate the associated instances when the Spot Fleet request is canceled. The default is to terminate the instances. To let the instances continue to run after the Spot Fleet request is
canceled, specify |
Value¶
A list with the following syntax:
list(
SuccessfulFleetRequests = list(
list(
CurrentSpotFleetRequestState = "submitted"|"active"|"cancelled"|"failed"|"cancelled_running"|"cancelled_terminating"|"modifying",
PreviousSpotFleetRequestState = "submitted"|"active"|"cancelled"|"failed"|"cancelled_running"|"cancelled_terminating"|"modifying",
SpotFleetRequestId = "string"
)
),
UnsuccessfulFleetRequests = list(
list(
Error = list(
Code = "fleetRequestIdDoesNotExist"|"fleetRequestIdMalformed"|"fleetRequestNotInCancellableState"|"unexpectedError",
Message = "string"
),
SpotFleetRequestId = "string"
)
)
)
Request syntax¶
svc$cancel_spot_fleet_requests(
DryRun = TRUE|FALSE,
SpotFleetRequestIds = list(
"string"
),
TerminateInstances = TRUE|FALSE
)
Examples¶
## Not run:
# This example cancels the specified Spot fleet request and terminates its
# associated Spot Instances.
svc$cancel_spot_fleet_requests(
SpotFleetRequestIds = list(
"sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE"
),
TerminateInstances = TRUE
)
# This example cancels the specified Spot fleet request without
# terminating its associated Spot Instances.
svc$cancel_spot_fleet_requests(
SpotFleetRequestIds = list(
"sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE"
),
TerminateInstances = FALSE
)
## End(Not run)