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 | awscc.amplify.domains |
Fields
- get (all properties)
- list (identifiers only)
| 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. |
| Name | Datatype | Description |
|---|---|---|
arn | string | |
region | string | AWS region. |
For more information, see AWS::Amplify::Domain.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | domains | INSERT | AppId, DomainName, SubDomainSettings, region |
delete_resource | domains | DELETE | Identifier, region |
update_resource | domains | UPDATE | Identifier, PatchDocument, region |
list_resources | domains_list_only | SELECT | region |
get_resource | domains | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 awscc.amplify.domains
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';
Lists all domains in a region.
SELECT
region,
arn
FROM awscc.amplify.domains_list_only
WHERE
region = '{{ region }}';
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 awscc.amplify.domains (
AppId,
DomainName,
SubDomainSettings,
region
)
SELECT
'{{ app_id }}',
'{{ domain_name }}',
'{{ sub_domain_settings }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.amplify.domains (
AppId,
AutoSubDomainCreationPatterns,
AutoSubDomainIAMRole,
CertificateSettings,
DomainName,
EnableAutoSubDomain,
SubDomainSettings,
region
)
SELECT
'{{ app_id }}',
'{{ auto_sub_domain_creation_patterns }}',
'{{ auto_sub_domain_iam_role }}',
'{{ certificate_settings }}',
'{{ domain_name }}',
'{{ enable_auto_sub_domain }}',
'{{ sub_domain_settings }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: domain
props:
- name: app_id
value: '{{ app_id }}'
- name: auto_sub_domain_creation_patterns
value:
- '{{ auto_sub_domain_creation_patterns[0] }}'
- name: auto_sub_domain_iam_role
value: '{{ auto_sub_domain_iam_role }}'
- name: certificate_settings
value:
certificate_type: '{{ certificate_type }}'
custom_certificate_arn: '{{ custom_certificate_arn }}'
- name: domain_name
value: '{{ domain_name }}'
- name: enable_auto_sub_domain
value: '{{ enable_auto_sub_domain }}'
- name: sub_domain_settings
value:
- prefix: '{{ prefix }}'
branch_name: '{{ branch_name }}'
UPDATE example
Use the following StackQL query and manifest file to update a domain resource, using stack-deploy.
/*+ update */
UPDATE awscc.amplify.domains
SET PatchDocument = string('{{ {
"AutoSubDomainCreationPatterns": auto_sub_domain_creation_patterns,
"AutoSubDomainIAMRole": auto_sub_domain_iam_role,
"CertificateSettings": certificate_settings,
"EnableAutoSubDomain": enable_auto_sub_domain,
"SubDomainSettings": sub_domain_settings
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.amplify.domains
WHERE
Identifier = '{{ arn }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the domains resource, the following permissions are required:
- Create
- Delete
- List
- Read
- Update
amplify:GetDomainAssociation,
amplify:CreateDomainAssociation,
route53:ListHostedZones,
route53:ChangeResourceRecordSets,
iam:PassRole,
amplify:TagResource
amplify:GetDomainAssociation,
amplify:DeleteDomainAssociation,
route53:ListHostedZones,
iam:PassRole
amplify:ListDomainAssociations,
iam:PassRole,
amplify:ListTagsForResource
amplify:GetDomainAssociation,
route53:ListHostedZones,
iam:PassRole,
amplify:ListTagsForResource
amplify:GetDomainAssociation,
amplify:UpdateDomainAssociation,
route53:ListHostedZones,
route53:ChangeResourceRecordSets,
iam:PassRole,
amplify:ListTagsForResource,
amplify:TagResource,
amplify:UntagResource