@SdkInternalApi
    final CreateVpcPeeringConnectionResult executeCreateVpcPeeringConnection(CreateVpcPeeringConnectionRequest createVpcPeeringConnectionRequest) {

        ExecutionContext executionContext = createExecutionContext(createVpcPeeringConnectionRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(Field.ClientExecuteTime);
        Request<CreateVpcPeeringConnectionRequest> request = null;
        Response<CreateVpcPeeringConnectionResult> response = null;

        try {
            awsRequestMetrics.startEvent(Field.RequestMarshallTime);
            try {
                request = new CreateVpcPeeringConnectionRequestProtocolMarshaller(protocolFactory).marshall(super
                        .beforeMarshalling(createVpcPeeringConnectionRequest));
                // Binds the request metrics to the current request.
                request.setAWSRequestMetrics(awsRequestMetrics);
                request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
                request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
                request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
                request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GameLift");
                request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateVpcPeeringConnection");
                request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);

            } finally {
                awsRequestMetrics.endEvent(Field.RequestMarshallTime);
            }

            HttpResponseHandler<AmazonWebServiceResponse<CreateVpcPeeringConnectionResult>> responseHandler = protocolFactory.createResponseHandler(
                    new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
                    new CreateVpcPeeringConnectionResultJsonUnmarshaller());
            response = invoke(request, responseHandler, executionContext);

            return response.getAwsResponse();

        } finally {

            endClientExecution(awsRequestMetrics, request, response);
        }
    }
<p>
Establishes a VPC peering connection between a virtual private cloud (VPC) in an Amazon Web Services account with
the VPC for your Amazon GameLift fleet. VPC peering enables the game servers on your fleet to communicate
directly with other Amazon Web Services resources. You can peer with VPCs in any Amazon Web Services account that
you have access to, including the account that you use to manage your Amazon GameLift fleets. You cannot peer
with VPCs that are in different Regions. For more information, see <a
href="https://docs.aws.amazon.com/gamelift/latest/developerguide/vpc-peering.html">VPC Peering with Amazon
GameLift Fleets</a>.
</p>
<p>
Before calling this operation to establish the peering connection, you first need to use <a
href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_CreateVpcPeeringAuthorization.html"
>CreateVpcPeeringAuthorization</a> and identify the VPC you want to peer with. Once the authorization for the
specified VPC is issued, you have 24 hours to establish the connection. These two operations handle all tasks
necessary to peer the two VPCs, including acceptance, updating routing tables, etc.
</p>
<p>
To establish the connection, call this operation from the Amazon Web Services account that is used to manage the
Amazon GameLift fleets. Identify the following values: (1) The ID of the fleet you want to be enable a VPC
peering connection for; (2) The Amazon Web Services account with the VPC that you want to peer with; and (3) The
ID of the VPC you want to peer with. This operation is asynchronous. If successful, a connection request is
created. You can use continuous polling to track the request's status using <a
href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeVpcPeeringConnections.html"
>DescribeVpcPeeringConnections</a> , or by monitoring fleet events for success or failure using <a
href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeFleetEvents.html"
>DescribeFleetEvents</a> .
</p>
<p>
<b>Related actions</b>
</p>
<p>
<a href=
"https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets"
>All APIs by task</a>
</p>

@param createVpcPeeringConnectionRequest
@return Result of the CreateVpcPeeringConnection operation returned by the service.
@throws UnauthorizedException
        The client failed authentication. Clients should not retry such requests.
@throws InvalidRequestException
        One or more parameter values in the request are invalid. Correct the invalid parameter values before
        retrying.
@throws NotFoundException
        THe requested resources was not found. The resource was either not created yet or deleted.
@throws InternalServiceException
        The service encountered an unrecoverable internal failure while processing the request. Clients can retry
        such requests immediately or after a waiting period.
@sample AmazonGameLift.CreateVpcPeeringConnection
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/CreateVpcPeeringConnection"
     target="_top">AWS API Documentation</a>
aws-java-sdk-gamelift/src/main/java/com/amazonaws/services/gamelift/AmazonGameLiftClient.java