domains
Creates, updates, deletes or gets a domain
resource or lists domains
in a region
Overview
Name | domains |
Type | Resource |
Description | The AWS::Amplify::Domain resource allows you to connect a custom domain to your app. |
Id | aws.amplify.domains |
Fields
Name | Datatype | Description |
---|---|---|
app_id | string | |
arn | string | |
auto_sub_domain_creation_patterns | array | |
auto_sub_domain_iam_role | string | |
certificate_record | string | |
certificate | object | |
certificate_settings | object | |
domain_name | string | |
domain_status | string | |
update_status | string | |
enable_auto_sub_domain | boolean | |
status_reason | string | |
sub_domain_settings | array | |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | AppId, DomainName, SubDomainSettings, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all domains
in a region.
SELECT
region,
app_id,
arn,
auto_sub_domain_creation_patterns,
auto_sub_domain_iam_role,
certificate_record,
certificate,
certificate_settings,
domain_name,
domain_status,
update_status,
enable_auto_sub_domain,
status_reason,
sub_domain_settings
FROM aws.amplify.domains
WHERE region = 'us-east-1';
Gets all properties from an individual domain
.
SELECT
region,
app_id,
arn,
auto_sub_domain_creation_patterns,
auto_sub_domain_iam_role,
certificate_record,
certificate,
certificate_settings,
domain_name,
domain_status,
update_status,
enable_auto_sub_domain,
status_reason,
sub_domain_settings
FROM aws.amplify.domains
WHERE region = 'us-east-1' AND data__Identifier = '<Arn>';
INSERT
example
Use the following StackQL query and manifest file to create a new domain
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.amplify.domains (
AppId,
DomainName,
SubDomainSettings,
region
)
SELECT
'{{ AppId }}',
'{{ DomainName }}',
'{{ SubDomainSettings }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.amplify.domains (
AppId,
AutoSubDomainCreationPatterns,
AutoSubDomainIAMRole,
CertificateSettings,
DomainName,
EnableAutoSubDomain,
SubDomainSettings,
region
)
SELECT
'{{ AppId }}',
'{{ AutoSubDomainCreationPatterns }}',
'{{ AutoSubDomainIAMRole }}',
'{{ CertificateSettings }}',
'{{ DomainName }}',
'{{ EnableAutoSubDomain }}',
'{{ SubDomainSettings }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: domain
props:
- name: AppId
value: '{{ AppId }}'
- name: AutoSubDomainCreationPatterns
value:
- '{{ AutoSubDomainCreationPatterns[0] }}'
- name: AutoSubDomainIAMRole
value: '{{ AutoSubDomainIAMRole }}'
- name: CertificateSettings
value:
CertificateType: '{{ CertificateType }}'
CustomCertificateArn: '{{ CustomCertificateArn }}'
- name: DomainName
value: '{{ DomainName }}'
- name: EnableAutoSubDomain
value: '{{ EnableAutoSubDomain }}'
- name: SubDomainSettings
value:
- Prefix: '{{ Prefix }}'
BranchName: '{{ BranchName }}'
DELETE
example
/*+ delete */
DELETE FROM aws.amplify.domains
WHERE data__Identifier = '<Arn>'
AND region = 'us-east-1';
Permissions
To operate on the domains
resource, the following permissions are required:
Create
amplify:CreateDomainAssociation,
route53:ListHostedZones,
route53:ChangeResourceRecordSets,
iam:PassRole,
amplify:TagResource
Delete
amplify:DeleteDomainAssociation,
iam:PassRole,
amplify:DeleteDomainAssociation
List
amplify:ListDomainAssociations,
iam:PassRole,
amplify:ListTagsForResource
Read
amplify:GetDomainAssociation,
route53:ListHostedZones,
iam:PassRole,
amplify:ListTagsForResource
Update
amplify:UpdateDomainAssociation,
route53:ListHostedZones,
route53:ChangeResourceRecordSets,
iam:PassRole,
amplify:ListTagsForResource,
amplify:TagResource,
amplify:UntagResource