Skip to content

update_domain_association async

update_domain_association(
    app_id: AppId,
    domain_name: DomainName,
    *,
    config_overrides: Optional[AsyncAmplifyClientConfig] = None,
    enable_auto_sub_domain: Optional[EnableAutoSubDomain] = None,
    sub_domain_settings: Optional[SubDomainSettings] = None,
    auto_sub_domain_creation_patterns: Optional[AutoSubDomainCreationPatterns] = None,
    auto_sub_domain_iam_role: Optional[AutoSubDomainIAMRole] = None,
    certificate_settings: Optional[CertificateSettings] = None,
) -> UpdateDomainAssociationResult

Creates a new domain association for an Amplify app.

Parameters:

  • app_id (AppId) –

    The unique ID for an Amplify app.

  • domain_name (DomainName) –

    The name of the domain.

  • enable_auto_sub_domain (Optional[EnableAutoSubDomain], default: None ) –

    Enables the automated creation of subdomains for branches.

  • sub_domain_settings (Optional[SubDomainSettings], default: None ) –

    Describes the settings for the subdomain.

  • auto_sub_domain_creation_patterns (Optional[AutoSubDomainCreationPatterns], default: None ) –

    Sets the branch patterns for automatic subdomain creation.

  • auto_sub_domain_iam_role (Optional[AutoSubDomainIAMRole], default: None ) –

    The required AWS Identity and Access Management (IAM) service role for the Amazon Resource Name (ARN) for automatically creating subdomains.

  • certificate_settings (Optional[CertificateSettings], default: None ) –

    The type of SSL/TLS certificate to use for your custom domain.

Raises:

Source code in docs_src/capo_amplify/_services/async_amplify.py
async def update_domain_association(
    self,
    app_id: "capo_amplify.types.app_id.AppId",
    domain_name: "capo_amplify.types.domain_name.DomainName",
    *,
    config_overrides: Optional[AsyncAmplifyClientConfig] = None,
    enable_auto_sub_domain: Optional[
        "capo_amplify.types.enable_auto_sub_domain.EnableAutoSubDomain"
    ] = None,
    sub_domain_settings: Optional[
        "capo_amplify.types.sub_domain_settings.SubDomainSettings"
    ] = None,
    auto_sub_domain_creation_patterns: Optional[
        "capo_amplify.types.auto_sub_domain_creation_patterns.AutoSubDomainCreationPatterns"
    ] = None,
    auto_sub_domain_iam_role: Optional[
        "capo_amplify.types.auto_sub_domain_iam_role.AutoSubDomainIAMRole"
    ] = None,
    certificate_settings: Optional[
        "capo_amplify.types.certificate_settings.CertificateSettings"
    ] = None,
) -> "capo_amplify.types.update_domain_association_result.UpdateDomainAssociationResult":
    """<p>Creates a new domain association for an Amplify app.</p>

    Args:
        app_id: <p> The unique ID for an Amplify app. </p>
        domain_name: <p> The name of the domain. </p>
        enable_auto_sub_domain: <p> Enables the automated creation of subdomains for branches. </p>
        sub_domain_settings: <p> Describes the settings for the subdomain. </p>
        auto_sub_domain_creation_patterns: <p> Sets the branch patterns for automatic subdomain creation. </p>
        auto_sub_domain_iam_role: <p> The required AWS Identity and Access Management (IAM) service role for the Amazon Resource Name (ARN) for automatically creating subdomains. </p>
        certificate_settings: <p>The type of SSL/TLS certificate to use for your custom domain.</p>

    Raises:
        capo_amplify.errors.bad_request_exception.BadRequestException: <p>A request contains unexpected data. </p>
        capo_amplify.errors.dependent_service_failure_exception.DependentServiceFailureException: <p>An operation failed because a dependent service threw an exception. </p>
        capo_amplify.errors.internal_failure_exception.InternalFailureException: <p>The service failed to perform an operation due to an internal issue. </p>
        capo_amplify.errors.not_found_exception.NotFoundException: <p>An entity was not found during an operation. </p>
        capo_amplify.errors.unauthorized_exception.UnauthorizedException: <p>An operation failed due to a lack of access. </p>
        capo_amplify.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_amplify.types.update_domain_association_request.UpdateDomainAssociationRequest]",
    ) -> AsyncOperationResponse[
        "capo_amplify.types.update_domain_association_result.UpdateDomainAssociationResult"
    ]:
        import capo_amplify._operations.amplify.update_domain_association

        (
            output,
            http_response,
        ) = await capo_amplify._operations.amplify.update_domain_association.async_update_domain_association(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateDomainAssociation")
    )
    input_: capo_amplify.types.update_domain_association_request.UpdateDomainAssociationRequest = {
        "app_id": app_id,
        "domain_name": domain_name,
    }
    if enable_auto_sub_domain is not None:
        input_["enable_auto_sub_domain"] = enable_auto_sub_domain
    if sub_domain_settings is not None:
        input_["sub_domain_settings"] = sub_domain_settings
    if auto_sub_domain_creation_patterns is not None:
        input_["auto_sub_domain_creation_patterns"] = (
            auto_sub_domain_creation_patterns
        )
    if auto_sub_domain_iam_role is not None:
        input_["auto_sub_domain_iam_role"] = auto_sub_domain_iam_role
    if certificate_settings is not None:
        input_["certificate_settings"] = certificate_settings

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