@SdkInternalApi
    final AttachCertificateToDistributionResult executeAttachCertificateToDistribution(
            AttachCertificateToDistributionRequest attachCertificateToDistributionRequest) {

        ExecutionContext executionContext = createExecutionContext(attachCertificateToDistributionRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(Field.ClientExecuteTime);
        Request<AttachCertificateToDistributionRequest> request = null;
        Response<AttachCertificateToDistributionResult> response = null;

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

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

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

            return response.getAwsResponse();

        } finally {

            endClientExecution(awsRequestMetrics, request, response);
        }
    }
<p>
Attaches an SSL/TLS certificate to your Amazon Lightsail content delivery network (CDN) distribution.
</p>
<p>
After the certificate is attached, your distribution accepts HTTPS traffic for all of the domains that are
associated with the certificate.
</p>
<p>
Use the <code>CreateCertificate</code> action to create a certificate that you can attach to your distribution.
</p>
<important>
<p>
Only certificates created in the <code>us-east-1</code> Amazon Web Services Region can be attached to Lightsail
distributions. Lightsail distributions are global resources that can reference an origin in any Amazon Web
Services Region, and distribute its content globally. However, all distributions are located in the
<code>us-east-1</code> Region.
</p>
</important>

@param attachCertificateToDistributionRequest
@return Result of the AttachCertificateToDistribution operation returned by the service.
@throws ServiceException
        A general service exception.
@throws InvalidInputException
        Lightsail throws this exception when user input does not conform to the validation rules of an input
        field.</p> <note>
        <p>
        Domain and distribution APIs are only available in the N. Virginia (<code>us-east-1</code>) Amazon Web
        Services Region. Please set your Amazon Web Services Region configuration to <code>us-east-1</code> to
        create, view, or edit these resources.
        </p>
@throws NotFoundException
        Lightsail throws this exception when it cannot find a resource.
@throws OperationFailureException
        Lightsail throws this exception when an operation fails to execute.
@throws AccessDeniedException
        Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to
        access a resource.
@throws UnauthenticatedException
        Lightsail throws this exception when the user has not been authenticated.
@sample AmazonLightsail.AttachCertificateToDistribution
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AttachCertificateToDistribution"
     target="_top">AWS API Documentation</a>
aws-java-sdk-lightsail/src/main/java/com/amazonaws/services/lightsail/AmazonLightsailClient.java