Skip to main content

domains

Creates, updates, deletes or gets a domain resource or lists domains in a region

Overview

Namedomains
TypeResource
DescriptionThe AWS::Amplify::Domain resource allows you to connect a custom domain to your app.
Idawscc.amplify.domains

Fields

NameDatatypeDescription
app_idstring
arnstring
auto_sub_domain_creation_patternsarray
auto_sub_domain_iam_rolestring
certificate_recordstring
certificateobject
certificate_settingsobject
domain_namestring
domain_statusstring
update_statusstring
enable_auto_sub_domainboolean
status_reasonstring
sub_domain_settingsarray
regionstringAWS region.

For more information, see AWS::Amplify::Domain.

Methods

NameResourceAccessible byRequired Params
create_resourcedomainsINSERTAppId, DomainName, SubDomainSettings, region
delete_resourcedomainsDELETEIdentifier, region
update_resourcedomainsUPDATEIdentifier, PatchDocument, region
list_resourcesdomains_list_onlySELECTregion
get_resourcedomainsSELECTIdentifier, region

SELECT examples

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 }}';

INSERT example

Use the following StackQL query and manifest file to create a new domain resource, using stack-deploy.

/*+ 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
;

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:

ParameterDescription
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:

amplify:GetDomainAssociation,
amplify:CreateDomainAssociation,
route53:ListHostedZones,
route53:ChangeResourceRecordSets,
iam:PassRole,
amplify:TagResource