deleteFleet method
Deletes everything related to a fleet. Before deleting a fleet, you must set the fleet's desired capacity to zero. See UpdateFleetCapacity.
If the fleet being deleted has a VPC peering connection, you first need to get a valid authorization (good for 24 hours) by calling CreateVpcPeeringAuthorization. You do not need to explicitly delete the VPC peering connection--this is done as part of the delete fleet process.
This operation removes the fleet and its resources. Once a fleet is deleted, you can no longer use any of the resource in that fleet.
Learn more
Related operations
- CreateFleet
- ListFleets
- DeleteFleet
- DescribeFleetAttributes
- UpdateFleetAttributes
- StartFleetActions or StopFleetActions
May throw NotFoundException. May throw InternalServiceException. May throw InvalidFleetStatusException. May throw UnauthorizedException. May throw InvalidRequestException. May throw TaggingFailedException.
Parameter fleetId
:
A unique identifier for a fleet to be deleted. You can use either the
fleet ID or ARN value.
Implementation
Future<void> deleteFleet({
required String fleetId,
}) async {
ArgumentError.checkNotNull(fleetId, 'fleetId');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'GameLift.DeleteFleet'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'FleetId': fleetId,
},
);
}