Skip to main content

domain_associations

Creates, updates, deletes, gets or lists a domain_associations resource.

Overview

Namedomain_associations
TypeResource
Idaws.amplify.domain_associations

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
auto_sub_domain_creation_patternsarraySets branch patterns for automatic subdomain creation.
auto_sub_domain_iam_rolestringThe required AWS Identity and Access Management (IAM) service role for the Amazon Resource Name (ARN) for automatically creating subdomains. (pattern: <code>^$|^arn:aws:iam::\d{12}:role.+</code>)
certificateobjectDescribes the SSL/TLS certificate for the domain association. This can be your own custom certificate or the default certificate that Amplify provisions for you. If you are updating your domain to use a different certificate, certificate points to the new certificate that is being created instead of the current active certificate. Otherwise, certificate points to the current active certificate.
certificate_verification_dns_recordstringThe DNS record for certificate verification.
domain_association_arnstringThe Amazon Resource Name (ARN) for the domain association.
domain_namestringThe name of the domain. (pattern: <code>^(((?!-)[A-Za-z0-9-]{0,62}[A-Za-z0-9]).)+((?!-)[A-Za-z0-9-]{1,62}[A-Za-z0-9])(.)?$</code>)
domain_statusstringThe current status of the domain association. (PENDING_VERIFICATION, IN_PROGRESS, AVAILABLE, IMPORTING_CUSTOM_CERTIFICATE, PENDING_DEPLOYMENT, AWAITING_APP_CNAME, FAILED, CREATING, REQUESTING_CERTIFICATE, UPDATING)
enable_auto_sub_domainbooleanEnables the automated creation of subdomains for branches.
status_reasonstringAdditional information that describes why the domain association is in the current state.
sub_domainsarrayThe subdomains for the domain association.
update_statusstringThe status of the domain update operation that is currently in progress. The following list describes the valid update states. REQUESTING_CERTIFICATE The certificate is in the process of being updated. PENDING_VERIFICATION Indicates that an Amplify managed certificate is in the process of being verified. This occurs during the creation of a custom domain or when a custom domain is updated to use a managed certificate. IMPORTING_CUSTOM_CERTIFICATE Indicates that an Amplify custom certificate is in the process of being imported. This occurs during the creation of a custom domain or when a custom domain is updated to use a custom certificate. PENDING_DEPLOYMENT Indicates that the subdomain or certificate changes are being propagated. AWAITING_APP_CNAME Amplify is waiting for CNAME records corresponding to subdomains to be propagated. If your custom domain is on Route 53, Amplify handles this for you automatically. For more information about custom domains, see Setting up custom domains in the Amplify Hosting User Guide. UPDATE_COMPLETE The certificate has been associated with a domain. UPDATE_FAILED The certificate has failed to be provisioned or associated, and there is no existing active certificate to roll back to. (REQUESTING_CERTIFICATE, PENDING_VERIFICATION, IMPORTING_CUSTOM_CERTIFICATE, PENDING_DEPLOYMENT, AWAITING_APP_CNAME, UPDATE_COMPLETE, UPDATE_FAILED)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_domain_associationselectapp_id, domain_name, regionReturns the domain information for an Amplify app.
list_domain_associationsselectapp_id, regionnextToken, maxResultsReturns the domain associations for an Amplify app.
create_domain_associationinsertapp_id, region, domainName, subDomainSettingsCreates a new domain association for an Amplify app. This action associates a custom domain with the Amplify app
update_domain_associationupdateapp_id, domain_name, regionCreates a new domain association for an Amplify app.
delete_domain_associationdeleteapp_id, domain_name, regionDeletes a domain association for an Amplify app.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
app_idstringThe unique id for an Amplify app.
domain_namestringThe name of the domain.
regionstringAWS region (default: us-east-1)
maxResultsintegerThe maximum number of records to list in a single response.
nextTokenstringA pagination token. Set to null to start listing apps from the start. If non-null, a pagination token is returned in a result. Pass its value in here to list more projects.

SELECT examples

Returns the domain information for an Amplify app.

SELECT
auto_sub_domain_creation_patterns,
auto_sub_domain_iam_role,
certificate,
certificate_verification_dns_record,
domain_association_arn,
domain_name,
domain_status,
enable_auto_sub_domain,
status_reason,
sub_domains,
update_status
FROM aws.amplify.domain_associations
WHERE app_id = '{{ app_id }}' -- required
AND domain_name = '{{ domain_name }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

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

INSERT INTO aws.amplify.domain_associations (
domainName,
enableAutoSubDomain,
subDomainSettings,
autoSubDomainCreationPatterns,
autoSubDomainIAMRole,
certificateSettings,
app_id,
region
)
SELECT
'{{ domainName }}' /* required */,
{{ enableAutoSubDomain }},
'{{ subDomainSettings }}' /* required */,
'{{ autoSubDomainCreationPatterns }}',
'{{ autoSubDomainIAMRole }}',
'{{ certificateSettings }}',
'{{ app_id }}',
'{{ region }}'
RETURNING
domain_association
;

UPDATE examples

Creates a new domain association for an Amplify app.

UPDATE aws.amplify.domain_associations
SET
enableAutoSubDomain = {{ enableAutoSubDomain }},
subDomainSettings = '{{ subDomainSettings }}',
autoSubDomainCreationPatterns = '{{ autoSubDomainCreationPatterns }}',
autoSubDomainIAMRole = '{{ autoSubDomainIAMRole }}',
certificateSettings = '{{ certificateSettings }}'
WHERE
app_id = '{{ app_id }}' --required
AND domain_name = '{{ domain_name }}' --required
AND region = '{{ region }}' --required
RETURNING
domain_association;

DELETE examples

Deletes a domain association for an Amplify app.

DELETE FROM aws.amplify.domain_associations
WHERE app_id = '{{ app_id }}' --required
AND domain_name = '{{ domain_name }}' --required
AND region = '{{ region }}' --required
;