aws-samples/amazon-cloudfront-secure-static-site

Migrating to this stack from another AWS account

zacharyozer opened this issue · 2 comments

Hi!

This stack is basically identical to what I've set up for a site I manage, so I'm trying to migrate to it in an attempt to standardize everything. In the process, I'm also moving the site to a new AWS account. The issue I'm encountering is that I'm not able to setup the Cloudfront distribution:

Resource handler returned message: "Invalid request provided: One or more aliases specified for the distribution includes an incorrectly configured DNS record that points to another CloudFront distribution. You must update the DNS record to correct the problem. For more information, see https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html#alternate-domain-names-restrictions

From the documentation:

You cannot add an alternate domain name to a CloudFront distribution if the same alternate domain name already exists in another CloudFront distribution

Any suggestions on how to work around this limitation? Some potential solutions I've seen:

Josh's answer is better than anything I can provide. I hope it helped.