Stan Luo
Stan Luo

Reputation: 3889

Route 53 - cloudfront distribution not showing when creating A record

I'm creating an A record in my Route 53 hosted zone for a subdomain. When I select "Alias to Cloudfront distribution", only US East zone shows in the list, containing an undesired distribution:

enter image description here

However I want to point to another distribution which is not showing in the list. Any idea why it's not showing? The distribution is ready and can be accessed using the cloudfront URL, pointing to a static s3 hosting bucket. I created it using amplify cli hosting, s3+cloudfront option if it matters.

Thanks for any help.

Upvotes: 4

Views: 3424

Answers (2)

Tamás Sallai
Tamás Sallai

Reputation: 3365

I encountered this even when the distribution was deployed with the correct alternate domain name added. It seems like a bug in the Console as copy-pasting the cloudfront domain (id.cloudfront.net) worked fine.

Upvotes: 1

Marcin
Marcin

Reputation: 238051

Based on the comments.

The issue was caused because the CloudFront distribution in question did not have Alternate Domain Name set witch matches the record in Route53. From docs:

The distribution must include an alternate domain name that matches the domain name that you want to use for your URLs instead of the domain name that CloudFront assigned to your distribution.

Upvotes: 12

Related Questions