Skip to content

create_domain_association

create_domain_association(
    app_name: AppName,
    domain_name: CustomDomainName,
    routing: Routing,
    dns_management_type: DnsManagementType,
    *,
    config_overrides: Optional[AmplifyGen3ClientConfig] = None,
    tags: Optional[TagMap] = None,
) -> CreateDomainAssociationResponse

Creates a domain association that connects a custom domain to a Gen 3 app.

Parameters:

  • app_name (AppName) –

    The name of the app.

  • domain_name (CustomDomainName) –

    The fully qualified domain name.

  • routing (Routing) –

    The routing configuration for the domain.

  • dns_management_type (DnsManagementType) –

    How DNS records for the domain are managed.

  • tags (Optional[TagMap], default: None ) –

    The tags to apply to the resource.

Raises:

Source code in docs_src/capo_amplifygen3/_services/amplify_gen3.py
def create_domain_association(
    self,
    app_name: "capo_amplifygen3.types.app_name.AppName",
    domain_name: "capo_amplifygen3.types.custom_domain_name.CustomDomainName",
    routing: "capo_amplifygen3.types.routing.Routing",
    dns_management_type: "capo_amplifygen3.types.dns_management_type.DnsManagementType",
    *,
    config_overrides: Optional[AmplifyGen3ClientConfig] = None,
    tags: Optional["capo_amplifygen3.types.tag_map.TagMap"] = None,
) -> "capo_amplifygen3.types.create_domain_association_response.CreateDomainAssociationResponse":
    """<p>Creates a domain association that connects a custom domain to a Gen 3 app.</p>

    Args:
        app_name: <p>The name of the app.</p>
        domain_name: <p>The fully qualified domain name.</p>
        routing: <p>The routing configuration for the domain.</p>
        dns_management_type: <p>How DNS records for the domain are managed.</p>
        tags: <p>The tags to apply to the resource.</p>

    Raises:
        capo_amplifygen3.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</p>
        capo_amplifygen3.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of the resource.</p>
        capo_amplifygen3.errors.internal_server_exception.InternalServerException: <p>An internal error occurred. Retry the request.</p>
        capo_amplifygen3.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource was not found.</p>
        capo_amplifygen3.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request would exceed a service quota for your account.</p>
        capo_amplifygen3.errors.throttling_exception.ThrottlingException: <p>The request was denied because the request rate exceeds the allowed limit.</p>
        capo_amplifygen3.errors.validation_exception.ValidationException: <p>The request contains invalid parameters or is otherwise malformed.</p>
        capo_amplifygen3.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_amplifygen3.types.create_domain_association_request.CreateDomainAssociationRequest]",
    ) -> OperationResponse[
        "capo_amplifygen3.types.create_domain_association_response.CreateDomainAssociationResponse"
    ]:
        import capo_amplifygen3._operations.omega.create_domain_association

        output, http_response = (
            capo_amplifygen3._operations.omega.create_domain_association.create_domain_association(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateDomainAssociation")
    )
    input_: capo_amplifygen3.types.create_domain_association_request.CreateDomainAssociationRequest = {
        "app_name": app_name,
        "domain_name": domain_name,
        "routing": routing,
        "dns_management_type": dns_management_type,
    }
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output