Cancel a Capacity Reservation Fleet - Amazon Elastic Compute Cloud

Cancel a Capacity Reservation Fleet

When you no longer need a Capacity Reservation Fleet and the capacity it reserves, you can cancel it. When you cancel a Fleet, its status changes to cancelled and it can no longer create new Capacity Reservations. Additionally, all of the individual Capacity Reservations in the Fleet are canceled. The instances that were previously running in the reserved capacity continue to run normally in the shared capacity.

To cancel a Capacity Reservation Fleet

Use the cancel-capacity-reservation-fleets AWS CLI command.

aws ec2 cancel-capacity-reservation-fleets \ --capacity-reservation-fleet-ids cr_fleet_ids

The following is example output.

{ "SuccessfulFleetCancellations": [ { "CurrentFleetState": "state", "PreviousFleetState": "state", "CapacityReservationFleetId": "cr_fleet_id_1" }, { "CurrentFleetState": "state", "PreviousFleetState": "state", "CapacityReservationFleetId": "cr_fleet_id_2" } ], "FailedFleetCancellations": [ { "CapacityReservationFleetId": "cr_fleet_id_3", "CancelCapacityReservationFleetError": [ { "Code": "code", "Message": "message" } ] } ] }

Example: Successful cancellation

aws ec2 cancel-capacity-reservation-fleets \ --capacity-reservation-fleet-ids crf-abcdef01234567890

The following is example output.

{ "SuccessfulFleetCancellations": [ { "CurrentFleetState": "cancelling", "PreviousFleetState": "active", "CapacityReservationFleetId": "crf-abcdef01234567890" } ], "FailedFleetCancellations": [] }