@SdkInternalApi
    final CreateSubnetGroupResult executeCreateSubnetGroup(CreateSubnetGroupRequest createSubnetGroupRequest) {

        ExecutionContext executionContext = createExecutionContext(createSubnetGroupRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(Field.ClientExecuteTime);
        Request<CreateSubnetGroupRequest> request = null;
        Response<CreateSubnetGroupResult> response = null;

        try {
            awsRequestMetrics.startEvent(Field.RequestMarshallTime);
            try {
                request = new CreateSubnetGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createSubnetGroupRequest));
                // 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, "MemoryDB");
                request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateSubnetGroup");
                request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);

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

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

            return response.getAwsResponse();

        } finally {

            endClientExecution(awsRequestMetrics, request, response);
        }
    }
<p>
Creates a subnet group. A subnet group is a collection of subnets (typically private) that you can designate for
your clusters running in an Amazon Virtual Private Cloud (VPC) environment. When you create a cluster in an
Amazon VPC, you must specify a subnet group. MemoryDB uses that subnet group to choose a subnet and IP addresses
within that subnet to associate with your nodes. For more information, see <a
href="https://docs.aws.amazon.com/MemoryDB/latest/devguide/subnetgroups.html">Subnets and subnet groups</a>.
</p>

@param createSubnetGroupRequest
@return Result of the CreateSubnetGroup operation returned by the service.
@throws SubnetGroupAlreadyExistsException
@throws SubnetGroupQuotaExceededException
@throws SubnetQuotaExceededException
@throws InvalidSubnetException
@throws ServiceLinkedRoleNotFoundException
@throws SubnetNotAllowedException
@throws TagQuotaPerResourceExceededException
@sample AmazonMemoryDB.CreateSubnetGroup
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/memorydb-2021-01-01/CreateSubnetGroup" target="_top">AWS API
     Documentation</a>
aws-java-sdk-memorydb/src/main/java/com/amazonaws/services/memorydb/AmazonMemoryDBClient.java