@SdkInternalApi
    final CreateNatGatewayResult executeCreateNatGateway(CreateNatGatewayRequest createNatGatewayRequest) {

        ExecutionContext executionContext = createExecutionContext(createNatGatewayRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(Field.ClientExecuteTime);
        Request<CreateNatGatewayRequest> request = null;
        Response<CreateNatGatewayResult> response = null;

        try {
            awsRequestMetrics.startEvent(Field.RequestMarshallTime);
            try {
                request = new CreateNatGatewayRequestMarshaller().marshall(super.beforeMarshalling(createNatGatewayRequest));
                // 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, "EC2");
                request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateNatGateway");
                request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);

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

            StaxResponseHandler<CreateNatGatewayResult> responseHandler = new StaxResponseHandler<CreateNatGatewayResult>(
                    new CreateNatGatewayResultStaxUnmarshaller());

            response = invoke(request, responseHandler, executionContext);

            return response.getAwsResponse();

        } finally {

            endClientExecution(awsRequestMetrics, request, response);
        }
    }
<p>
Creates a NAT gateway in the specified subnet. This action creates a network interface in the specified subnet
with a private IP address from the IP address range of the subnet. You can create either a public NAT gateway or
a private NAT gateway.
</p>
<p>
With a public NAT gateway, internet-bound traffic from a private subnet can be routed to the NAT gateway, so that
instances in a private subnet can connect to the internet.
</p>
<p>
With a private NAT gateway, private communication is routed across VPCs and on-premises networks through a
transit gateway or virtual private gateway. Common use cases include running large workloads behind a small pool
of allowlisted IPv4 addresses, preserving private IPv4 addresses, and communicating between overlapping networks.
</p>
<p>
For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html">NAT
gateways</a> in the <i>Amazon VPC User Guide</i>.
</p>
<important>
<p>
When you create a public NAT gateway and assign it an EIP or secondary EIPs, the network border group of the EIPs
must match the network border group of the Availability Zone (AZ) that the public NAT gateway is in. If it's not
the same, the NAT gateway will fail to launch. You can see the network border group for the subnet's AZ by
viewing the details of the subnet. Similarly, you can view the network border group of an EIP by viewing the
details of the EIP address. For more information about network border groups and EIPs, see <a
href="https://docs.aws.amazon.com/vpc/latest/userguide/vpc-eips.html#allocate-eip">Allocate an Elastic IP
address</a> in the <i>Amazon VPC User Guide</i>.
</p>
</important>

@param createNatGatewayRequest
@return Result of the CreateNatGateway operation returned by the service.
@sample AmazonEC2.CreateNatGateway
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNatGateway" target="_top">AWS API
     Documentation</a>
aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/AmazonEC2Client.java