domain_associations
Creates, updates, deletes, gets or lists a domain_associations resource.
Overview
| Name | domain_associations |
| Type | Resource |
| Id | aws.amplify.domain_associations |
Fields
The following fields are returned by SELECT queries:
- get_domain_association
- list_domain_associations
| Name | Datatype | Description |
|---|---|---|
auto_sub_domain_creation_patterns | array | Sets branch patterns for automatic subdomain creation. |
auto_sub_domain_iam_role | string | The 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>) |
certificate | object | Describes 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_record | string | The DNS record for certificate verification. |
domain_association_arn | string | The Amazon Resource Name (ARN) for the domain association. |
domain_name | string | The 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_status | string | The 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_domain | boolean | Enables the automated creation of subdomains for branches. |
status_reason | string | Additional information that describes why the domain association is in the current state. |
sub_domains | array | The subdomains for the domain association. |
update_status | string | The 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) |
| Name | Datatype | Description |
|---|---|---|
auto_sub_domain_creation_patterns | array | Sets branch patterns for automatic subdomain creation. |
auto_sub_domain_iam_role | string | The 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>) |
certificate | object | Describes 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_record | string | The DNS record for certificate verification. |
domain_association_arn | string | The Amazon Resource Name (ARN) for the domain association. |
domain_name | string | The 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_status | string | The 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_domain | boolean | Enables the automated creation of subdomains for branches. |
status_reason | string | Additional information that describes why the domain association is in the current state. |
sub_domains | array | The subdomains for the domain association. |
update_status | string | The 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_domain_association | select | app_id, domain_name, region | Returns the domain information for an Amplify app. | |
list_domain_associations | select | app_id, region | nextToken, maxResults | Returns the domain associations for an Amplify app. |
create_domain_association | insert | app_id, region, domainName, subDomainSettings | Creates a new domain association for an Amplify app. This action associates a custom domain with the Amplify app | |
update_domain_association | update | app_id, domain_name, region | Creates a new domain association for an Amplify app. | |
delete_domain_association | delete | app_id, domain_name, region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
app_id | string | The unique id for an Amplify app. |
domain_name | string | The name of the domain. |
region | string | AWS region (default: us-east-1) |
maxResults | integer | The maximum number of records to list in a single response. |
nextToken | string | A 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
- get_domain_association
- list_domain_associations
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
;
Returns the domain associations 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 region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
;
INSERT examples
- create_domain_association
- Manifest
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
;
# Description fields are for documentation purposes
- name: domain_associations
props:
- name: app_id
value: "{{ app_id }}"
description: Required parameter for the domain_associations resource.
- name: region
value: "{{ region }}"
description: Required parameter for the domain_associations resource.
- name: domainName
value: "{{ domainName }}"
- name: enableAutoSubDomain
value: {{ enableAutoSubDomain }}
- name: subDomainSettings
value:
- prefix: "{{ prefix }}"
branchName: "{{ branchName }}"
- name: autoSubDomainCreationPatterns
value:
- "{{ autoSubDomainCreationPatterns }}"
- name: autoSubDomainIAMRole
value: "{{ autoSubDomainIAMRole }}"
- name: certificateSettings
description: |
The type of SSL/TLS certificate to use for your custom domain. If a certificate type isn't specified, Amplify uses the default AMPLIFY_MANAGED certificate.
value:
type_: "{{ type_ }}"
customCertificateArn: "{{ customCertificateArn }}"
UPDATE examples
- update_domain_association
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
- delete_domain_association
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
;