AmplifyGen3 / Client / create_domain_association

create_domain_association

AmplifyGen3.Client.create_domain_association(**kwargs)

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

See also: AWS API Documentation

Request Syntax

response = client.create_domain_association(
    AppName='string',
    DomainName='string',
    Routing={
        'alias': {
            'AliasArn': 'string'
        },
        'redirect': {
            'TargetUrl': 'string',
            'StatusCode': 'HTTP_301'|'HTTP_302'|'HTTP_307'|'HTTP_308'
        }
    },
    DnsManagementType='ROUTE_53'|'MANUAL'|'NS_DELEGATION',
    Tags={
        'string': 'string'
    }
)
Parameters:
  • AppName (string) –

    [REQUIRED]

    The name of the app.

  • DomainName (string) –

    [REQUIRED]

    The fully qualified domain name.

  • Routing (dict) –

    [REQUIRED]

    The routing configuration for the domain.

    Note

    This is a Tagged Union structure. Only one of the following top level keys can be set: alias, redirect.

    • alias (dict) –

      Routes traffic for the domain to an alias.

      • AliasArn (string) – [REQUIRED]

        The Amazon Resource Name (ARN) of the alias.

    • redirect (dict) –

      Redirects traffic for the domain to another URL.

      • TargetUrl (string) – [REQUIRED]

        The URL to redirect requests to.

      • StatusCode (string) – [REQUIRED]

        The HTTP status code to return for the redirect.

  • DnsManagementType (string) –

    [REQUIRED]

    How DNS records for the domain are managed.

  • Tags (dict) –

    The tags to apply to the resource.

    • (string) –

      • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'DomainAssociationArn': 'string',
    'DomainStatus': 'CREATING'|'PENDING_CERTIFICATE_VALIDATION'|'PENDING_OWNERSHIP_VALIDATION'|'PENDING_DNS_VALIDATION'|'PENDING_NS_DELEGATION'|'PROVISIONING'|'ACTIVE'|'UPDATING'|'DELETING'|'CREATE_FAILED'|'UPDATE_FAILED'|'DELETE_FAILED',
    'DnsRecords': [
        {
            'Type': 'CNAME'|'TXT'|'A'|'AAAA'|'NS',
            'Name': 'string',
            'Value': 'string',
            'Purpose': 'CERTIFICATE_VALIDATION'|'OWNERSHIP_VERIFICATION'|'NAMESERVER_DELEGATION'|'DNS_VALIDATION'
        },
    ]
}

Response Structure

  • (dict) –

    • DomainAssociationArn (string) –

      The Amazon Resource Name (ARN) of the domain association.

    • DomainStatus (string) –

      The status of the domain association.

    • DnsRecords (list) –

      The DNS records that must be configured for the domain.

      • (dict) –

        A DNS record that must be configured for a domain association.

        • Type (string) –

          The type of the DNS record.

        • Name (string) –

          The name of the DNS record.

        • Value (string) –

          The value of the DNS record.

        • Purpose (string) –

          The purpose of the DNS record.

Exceptions