deleteVpcPeeringConnection method

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

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. You can check for an authorization by calling DescribeVpcPeeringAuthorizations or request a new one using CreateVpcPeeringAuthorization.

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

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

Parameter fleetId : A unique identifier for a 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. This value is included in the VpcPeeringConnection object, which can be retrieved by calling DescribeVpcPeeringConnections.

Implementation

Future<void> deleteVpcPeeringConnection({
  required String fleetId,
  required String vpcPeeringConnectionId,
}) async {
  ArgumentError.checkNotNull(fleetId, 'fleetId');
  ArgumentError.checkNotNull(
      vpcPeeringConnectionId, 'vpcPeeringConnectionId');
  _s.validateStringLength(
    'vpcPeeringConnectionId',
    vpcPeeringConnectionId,
    1,
    1024,
    isRequired: true,
  );
  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,
    },
  );
}