@SdkInternalApi
    final CreateDomainResult executeCreateDomain(CreateDomainRequest createDomainRequest) {

        ExecutionContext executionContext = createExecutionContext(createDomainRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(Field.ClientExecuteTime);
        Request<CreateDomainRequest> request = null;
        Response<CreateDomainResult> response = null;

        try {
            awsRequestMetrics.startEvent(Field.RequestMarshallTime);
            try {
                request = new CreateDomainRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createDomainRequest));
                // 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, "Customer Profiles");
                request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateDomain");
                request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);

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

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

            return response.getAwsResponse();

        } finally {

            endClientExecution(awsRequestMetrics, request, response);
        }
    }
<p>
Creates a domain, which is a container for all customer data, such as customer profile attributes, object types,
profile keys, and encryption keys. You can create multiple domains, and each domain can have multiple third-party
integrations.
</p>
<p>
Each Amazon Connect instance can be associated with only one domain. Multiple Amazon Connect instances can be
associated with one domain.
</p>
<p>
Use this API or <a
href="https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_UpdateDomain.html">UpdateDomain</a> to
enable <a href="https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_GetMatches.html">identity
resolution</a>: set <code>Matching</code> to true.
</p>
<p>
To prevent cross-service impersonation when you call this API, see <a
href="https://docs.aws.amazon.com/connect/latest/adminguide/cross-service-confused-deputy-prevention.html"
>Cross-service confused deputy prevention</a> for sample policies that you should apply.
</p>
<note>
<p>
It is not possible to associate a Customer Profiles domain with an Amazon Connect Instance directly from the API.
If you would like to create a domain and associate a Customer Profiles domain, use the Amazon Connect admin
website. For more information, see <a href=
"https://docs.aws.amazon.com/connect/latest/adminguide/enable-customer-profiles.html#enable-customer-profiles-step1"
>Enable Customer Profiles</a>.
</p>
<p>
Each Amazon Connect instance can be associated with only one domain. Multiple Amazon Connect instances can be
associated with one domain.
</p>
</note>

@param createDomainRequest
@return Result of the CreateDomain operation returned by the service.
@throws BadRequestException
        The input you provided is invalid.
@throws ResourceNotFoundException
        The requested resource does not exist, or access was denied.
@throws AccessDeniedException
        You do not have sufficient access to perform this action.
@throws ThrottlingException
        You exceeded the maximum number of requests.
@throws InternalServerException
        An internal service error occurred.
@sample AmazonCustomerProfiles.CreateDomain
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/customer-profiles-2020-08-15/CreateDomain" target="_top">AWS
     API Documentation</a>
aws-java-sdk-customerprofiles/src/main/java/com/amazonaws/services/customerprofiles/AmazonCustomerProfilesClient.java