Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 822
Stanley Luo Avatar asked Sep 05 '25 03:09

Stanley Luo


2 Answers

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.

like image 141
Marcin Avatar answered Sep 07 '25 21:09

Marcin


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.

like image 40
Tamás Sallai Avatar answered Sep 07 '25 19:09

Tamás Sallai