- Newest
- Most votes
- Most comments
The SLR creation failures for amplify.amazonaws.com and cloudfront.amazonaws.com are expected. Amplify does not use service-linked roles (confirmed in AWS docs: "Amplify does not support service-linked roles"). CloudFront has an SLR only for VPC Origins, which uses a different service principal and is created automatically. Neither service has an SLR template matching what you tried. This is not your problem.
Your actual error is: "One or more aliases specified for the distribution includes an incorrectly configured DNS record that points to another CloudFront distribution."
This is the CNAMEAlreadyExists error. It means your domain (or a subdomain) has a DNS record (CNAME or ALIAS) that resolves to a CloudFront distribution that already claims that domain as an alternate domain name. Two CloudFront distributions cannot use the same alternate domain name simultaneously.
To resolve:
- Check if you have a CNAME or ALIAS record pointing to a
.cloudfront.netdomain:
dig your-domain.com CNAME dig www.your-domain.com CNAME
- Find the distribution claiming your domain:
aws cloudfront list-distributions \ --query "DistributionList.Items[?Aliases.Items[?contains(@,'your-domain.com')]].[Id,DomainName,Aliases.Items]" \ --output table
-
If found in your account, either delete the distribution or remove the alternate domain name from it.
-
If NOT found in your account (common with previously deleted Amplify apps), open a support case. AWS can disassociate the domain from the orphaned distribution on the backend.
-
If you previously used this domain with Amplify in a different region or account, the old app may still hold the domain association even if the app appears deleted. Check all regions:
for region in us-east-1 us-west-2 eu-west-1 ap-south-1; do echo "--- $region ---" aws amplify list-apps --region $region \ --query 'apps[].{name:name,id:appId}' --output table done
References:
- CNAMEAlreadyExists troubleshooting: https://repost.aws/knowledge-center/resolve-cnamealreadyexists-error
- Amplify custom domains: https://docs.aws.amazon.com/amplify/latest/userguide/custom-domains.html
answered a year ago
