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

Create a secure static website with CloudFront for your registered domain.
Apache License 2.0
389 stars 140 forks source link

Migrating to this stack from another AWS account #51

Closed zacharyozer closed 2 years ago

zacharyozer commented 2 years ago

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:

joshbean commented 2 years ago

You can also try the steps here: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html#alternate-domain-names-move

ConnorKirk commented 2 years ago

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