AWS amplify: Amplify: document cross-account custom domain ownership verification
Summary
Rewrites the '400 error for cross-account domain association' troubleshooting section to explain that associating a domain already used by another AWS account requires domain ownership verification, and adds two remediation procedures: adding a subdomain for automatic verification, or proving control with a DNS TXT record (_amplify-cross-account-ownership-proof-<accountid>) before contacting Support to complete manual verification.
Security assessment
The added content documents an ownership-verification control that prevents one AWS account from associating a domain already owned/associated by another account in the same Region, which is a domain-hijack/takeover prevention measure; it also prescribes a signed-style TXT proof record bound to the requesting account ID. It explains an existing security mechanism rather than fixing a specific disclosed vulnerability, so it is security documentation of medium impact.
Evidence
+This type of request is a cross-account domain association, and it requires domain ownership verification. To resolve the error, use one of the following options:
Diff
diff --git a/amplify/latest/userguide/troubleshooting-custom-domains.md b/amplify/latest/userguide/troubleshooting-custom-domains.md index 5e4af78..be0653e 100644 --- a//amplify/latest/userguide/troubleshooting-custom-domains.md +++ b//amplify/latest/userguide/troubleshooting-custom-domains.md @@ -7 +7 @@ -I need to verify that my CNAME resolvesMy domain hosted with a third-party is stuck in the Pending Verification stateMy domain hosted with Amazon Route 53 is stuck in the Pending Verification stateMy app with multi-level subdomains is stuck in the Pending Verification stateMy DNS provider doesn't support A records with fully qualified domain namesI get a CNAMEAlreadyExistsException errorI get an Additional Verification Required errorI get a 404 error on the CloudFront URLI get SSL certificate or HTTPS errors when visiting my domainPath components not supported in domain redirectsI get a 400 error for cross account domain association +I need to verify that my CNAME resolvesMy domain hosted with a third-party is stuck in the Pending Verification stateMy domain hosted with Amazon Route 53 is stuck in the Pending Verification stateMy app with multi-level subdomains is stuck in the Pending Verification stateMy DNS provider doesn't support A records with fully qualified domain namesI get a CNAMEAlreadyExistsException errorI get an Additional Verification Required errorI get a 404 error on the CloudFront URLI get SSL certificate or HTTPS errors when visiting my domainPath components not supported in domain redirectsI get a 400 error for cross-account domain association @@ -37 +37 @@ If you don't see a solution to your issue here, contact Support. For more inform - * I get a 400 error for cross account domain association + * I get a 400 error for cross-account domain association @@ -205 +205,65 @@ Domain redirects only match the hostname portion. Path components in domain-base -## I get a 400 error for cross account domain association +## I get a 400 error for cross-account domain association + +When you add a custom domain, you might get the following error. + + + The requested domain cannot be used by this AWS account. Please contact AWS support for assistance. + +This error occurs when the domain that you're adding is already or was previously associated with an Amplify app in a different AWS account in the same AWS Region. + +This type of request is a cross-account domain association, and it requires domain ownership verification. To resolve the error, use one of the following options: + + * Option 1 – Add a subdomain so that Amplify verifies ownership automatically. + + * Option 2 – Add a TXT record and contact Support to verify ownership manually. + + + + +###### To verify domain ownership automatically by adding a subdomain (Option 1) + +If your domain association request includes at least one subdomain, Amplify can verify domain ownership automatically. This option doesn't require a TXT record or a support case. + + 1. When you add the domain association, specify at least one subdomain. For example, when you add `example.com`, also add `www` as a subdomain (`www.example.com`). + + 2. After the domain association succeeds, you can remove the subdomain if you don't need it. + + + + +If you can't include a subdomain in your request, or you still get the 400 error after you add one, use Option 2. + +###### To verify domain ownership manually with a TXT record (Option 2) + +You can prove that you control the domain by adding a DNS TXT record before you contact Support. + + 1. In your DNS provider, create a TXT record with the following values, replacing `111122223333` with the ID of the AWS account that is requesting the domain association, and `example.com` with the domain that you are associating: + +Record name + + +`_amplify-cross-account-ownership-proof-`111122223333`.`example.com`` + +Record type + + +`TXT` + +Record value + + +`This domain is owned by `111122223333`` + +If your DNS provider appends your domain name to the record name automatically, enter only `_amplify-cross-account-ownership-proof-`111122223333``. + + 2. After the record propagates, verify that it resolves. For example, run the following command. + + nslookup -type=TXT _amplify-cross-account-ownership-proof-111122223333.example.com + +A successful response includes `"This domain is owned by `111122223333`"`. If the record doesn't resolve, confirm that your DNS provider saved the leading underscore in the record name, that the record name doesn't repeat your domain name, and that the account ID in the record name matches the account ID in the record value. + + 3. Contact Support with your domain association request. Include the domain name, your AWS account ID, the AWS Region of your Amplify app, and the TXT record that you created. Support completes the cross-account domain verification. + + 4. After Support confirms the verification, retry the domain association. You can delete the TXT record after the domain association succeeds. + + @@ -207 +270,0 @@ Domain redirects only match the hostname portion. Path components in domain-base -When initiating a DomainAssociation request for an Amplify app with a domain that is already or was previously associated with different Amplify App(s) in other AWS account(s) in the same region, this is considered a cross account domain association. If you get this error this means that you are attempting cross account domain association which requires manual verification. If you would like to proceed with a cross account domain association, please contact AWS support for assistance.