deleteVpcPeeringConnection method

Future<void> deleteVpcPeeringConnection({
  1. required String fleetId,
  2. required String vpcPeeringConnectionId,
})

This API works with the following fleet types: EC2

Removes a VPC peering connection. To delete the connection, you must have a valid authorization for the VPC peering connection that you want to delete..

Once a valid authorization exists, call this operation from the Amazon Web Services account that is used to manage the Amazon GameLift Servers fleets. Identify the connection to delete by the connection ID and fleet ID. If successful, the connection is removed.

Related actions

All APIs by task

May throw InternalServiceException. May throw InvalidRequestException. May throw NotFoundException. May throw UnauthorizedException.

Parameter fleetId : A unique identifier for the fleet. This fleet specified must match the fleet referenced in the VPC peering connection record. You can use either the fleet ID or ARN value.

Parameter vpcPeeringConnectionId : A unique identifier for a VPC peering connection.

Implementation

Future<void> deleteVpcPeeringConnection({
  required String fleetId,
  required String vpcPeeringConnectionId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'GameLift.DeleteVpcPeeringConnection'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'FleetId': fleetId,
      'VpcPeeringConnectionId': vpcPeeringConnectionId,
    },
  );
}