create_domain_association

create_domain_association(**kwargs)

Creates a new domain association for an Amplify app. This action associates a custom domain with the Amplify app

See also: AWS API Documentation

Request Syntax

response = client.create_domain_association(
    appId='string',
    domainName='string',
    enableAutoSubDomain=True|False,
    subDomainSettings=[
        {
            'prefix': 'string',
            'branchName': 'string'
        },
    ],
    autoSubDomainCreationPatterns=[
        'string',
    ],
    autoSubDomainIAMRole='string'
)
Parameters
  • appId (string) --

    [REQUIRED]

    The unique ID for an Amplify app.

  • domainName (string) --

    [REQUIRED]

    The domain name for the domain association.

  • enableAutoSubDomain (boolean) -- Enables the automated creation of subdomains for branches.
  • subDomainSettings (list) --

    [REQUIRED]

    The setting for the subdomain.

    • (dict) --

      Describes the settings for the subdomain.

      • prefix (string) -- [REQUIRED]

        The prefix setting for the subdomain.

      • branchName (string) -- [REQUIRED]

        The branch name setting for the subdomain.

  • autoSubDomainCreationPatterns (list) --

    Sets the branch patterns for automatic subdomain creation.

    • (string) --
  • autoSubDomainIAMRole (string) -- The required AWS Identity and Access Management (IAM) service role for the Amazon Resource Name (ARN) for automatically creating subdomains.
Return type

dict

Returns

Response Syntax

{
    'domainAssociation': {
        'domainAssociationArn': 'string',
        'domainName': 'string',
        'enableAutoSubDomain': True|False,
        'autoSubDomainCreationPatterns': [
            'string',
        ],
        'autoSubDomainIAMRole': 'string',
        'domainStatus': 'PENDING_VERIFICATION'|'IN_PROGRESS'|'AVAILABLE'|'PENDING_DEPLOYMENT'|'FAILED'|'CREATING'|'REQUESTING_CERTIFICATE'|'UPDATING',
        'statusReason': 'string',
        'certificateVerificationDNSRecord': 'string',
        'subDomains': [
            {
                'subDomainSetting': {
                    'prefix': 'string',
                    'branchName': 'string'
                },
                'verified': True|False,
                'dnsRecord': 'string'
            },
        ]
    }
}

Response Structure

  • (dict) --

    The result structure for the create domain association request.

    • domainAssociation (dict) --

      Describes the structure of a domain association, which associates a custom domain with an Amplify app.

      • domainAssociationArn (string) --

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

      • domainName (string) --

        The name of the domain.

      • enableAutoSubDomain (boolean) --

        Enables the automated creation of subdomains for branches.

      • autoSubDomainCreationPatterns (list) --

        Sets branch patterns for automatic subdomain creation.

        • (string) --
      • autoSubDomainIAMRole (string) --

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

      • domainStatus (string) --

        The current status of the domain association.

      • statusReason (string) --

        The reason for the current status of the domain association.

      • certificateVerificationDNSRecord (string) --

        The DNS record for certificate verification.

      • subDomains (list) --

        The subdomains for the domain association.

        • (dict) --

          The subdomain for the domain association.

          • subDomainSetting (dict) --

            Describes the settings for the subdomain.

            • prefix (string) --

              The prefix setting for the subdomain.

            • branchName (string) --

              The branch name setting for the subdomain.

          • verified (boolean) --

            The verified status of the subdomain

          • dnsRecord (string) --

            The DNS record for the subdomain.

Exceptions

  • Amplify.Client.exceptions.BadRequestException
  • Amplify.Client.exceptions.UnauthorizedException
  • Amplify.Client.exceptions.NotFoundException
  • Amplify.Client.exceptions.InternalFailureException
  • Amplify.Client.exceptions.LimitExceededException
  • Amplify.Client.exceptions.DependentServiceFailureException