Skip to content

setup_instance_https async

setup_instance_https(
    instance_name: ResourceName,
    email_address: EmailAddress,
    domain_names: SetupDomainNameList,
    certificate_provider: CertificateProvider,
    *,
    config_overrides: Optional[AsyncLightsailClientConfig] = None,
) -> SetupInstanceHttpsResult

Creates an SSL/TLS certificate that secures traffic for your website. After the certificate is created, it is installed on the specified Lightsail instance.

If you provide more than one domain name in the request, at least one name must be less than or equal to 63 characters in length.

Parameters:

  • instance_name (ResourceName) –

    The name of the Lightsail instance.

  • email_address (EmailAddress) –

    The contact method for SSL/TLS certificate renewal alerts. You can enter one email address.

  • domain_names (SetupDomainNameList) –

    The name of the domain and subdomains that were specified for the SSL/TLS certificate.

  • certificate_provider (CertificateProvider) –

    The certificate authority that issues the SSL/TLS certificate.

Raises:

  • AccessDeniedException –

    Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

  • InvalidInputException –

    Lightsail throws this exception when user input does not conform to the validation rules of an input field.

    Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

  • NotFoundException –

    Lightsail throws this exception when it cannot find a resource.

  • RegionSetupInProgressException –

    Lightsail throws this exception when an operation is performed on resources in an opt-in Region that is currently being set up.

  • ServiceException –

    A general service exception.

  • UnauthenticatedException –

    Lightsail throws this exception when the user has not been authenticated.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_lightsail/_services/async_lightsail.py
async def setup_instance_https(
    self,
    instance_name: "capo_lightsail.types.resource_name.ResourceName",
    email_address: "capo_lightsail.types.email_address.EmailAddress",
    domain_names: "capo_lightsail.types.setup_domain_name_list.SetupDomainNameList",
    certificate_provider: "capo_lightsail.types.certificate_provider.CertificateProvider",
    *,
    config_overrides: Optional[AsyncLightsailClientConfig] = None,
) -> "capo_lightsail.types.setup_instance_https_result.SetupInstanceHttpsResult":
    """<p>Creates an SSL/TLS certificate that secures traffic for your website. After the certificate is created, it is installed on the specified Lightsail instance.</p> <p>If you provide more than one domain name in the request, at least one name must be less than or equal to 63 characters in length.</p>

    Args:
        instance_name: <p>The name of the Lightsail instance.</p>
        email_address: <p>The contact method for SSL/TLS certificate renewal alerts. You can enter one email address. </p>
        domain_names: <p>The name of the domain and subdomains that were specified for the SSL/TLS certificate.</p>
        certificate_provider: <p>The certificate authority that issues the SSL/TLS certificate.</p>

    Raises:
        capo_lightsail.errors.access_denied_exception.AccessDeniedException: <p>Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.</p>
        capo_lightsail.errors.invalid_input_exception.InvalidInputException: <p>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> </note>
        capo_lightsail.errors.not_found_exception.NotFoundException: <p>Lightsail throws this exception when it cannot find a resource.</p>
        capo_lightsail.errors.region_setup_in_progress_exception.RegionSetupInProgressException: <p>Lightsail throws this exception when an operation is performed on resources in an opt-in Region that is currently being set up.</p>
        capo_lightsail.errors.service_exception.ServiceException: <p>A general service exception.</p>
        capo_lightsail.errors.unauthenticated_exception.UnauthenticatedException: <p>Lightsail throws this exception when the user has not been authenticated.</p>
        capo_lightsail.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_lightsail.types.setup_instance_https_request.SetupInstanceHttpsRequest]",
    ) -> AsyncOperationResponse[
        "capo_lightsail.types.setup_instance_https_result.SetupInstanceHttpsResult"
    ]:
        import capo_lightsail._operations.lightsail_20161128.setup_instance_https

        (
            output,
            http_response,
        ) = await capo_lightsail._operations.lightsail_20161128.setup_instance_https.async_setup_instance_https(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_lightsail.types.setup_instance_https_request.SetupInstanceHttpsRequest",
    ) -> dict[str, Any]:
        import capo_lightsail.types.setup_instance_https_request

        return capo_lightsail.types.setup_instance_https_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("SetupInstanceHttps", redact_input=_redact_input),
    )
    input_: capo_lightsail.types.setup_instance_https_request.SetupInstanceHttpsRequest = {
        "instance_name": instance_name,
        "email_address": email_address,
        "domain_names": domain_names,
        "certificate_provider": certificate_provider,
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output