107

I’m trying to add a route 53 record set that points to my cloudfront distribution. However, when I select ‘create record set’ in route 53 and click the alias target in the subsequent panel, the cloud front distribution is not listed. All I get is ‘No targets available’. My Distribution has been created and is enabled (and is working). I have added a CName to my distribution with the same domain name that I’m setting up in Route53, but it still doesn’t show.

How do I get my distribution to show in the Alias Target field so that I can point a Route53 ‘a’ record to it?

Thanks

LDJ
  • 6,896
  • 9
  • 52
  • 87
  • 5
    The console is notoriously sluggish about populating that box. Click into it, click away from it, click into it again seems like it might be the correct magical incantation. Did you wait until your Cloudfront distribution's status said "Deployed?" – Michael - sqlbot Jun 03 '15 at 10:56
  • 3
    [This article](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-values-alias.html) describes it: the alternate domain name (CNAME) should be not empty to be visible in the dropdown for A-record alias. – boldnik Mar 05 '19 at 13:19
  • @Michael-sqlbot I also had to refresh the Route53 page to see it. – qu1j0t3 May 14 '20 at 21:01
  • i changed my cloudfront security policy to TLSv1.1_2016 and it resolve this issue for me – CodeDoctorJL Aug 04 '20 at 19:57

10 Answers10

111

Combining several correct but incomplete answers:

  1. Only A records and AAAA are supported. Not CNAME records.
  2. The Route53 "Alias Target" box matches against CloudFront distributions' "Alternate Domain Names" field. If you're creating a new record set for something.example.com, you should have already set the alternate domain name for one of your distributions to something.example.com.
  3. The Route53 Management Console can be slow, and it might not find your distribution right away — wait until the distribution status is Deployed.
Sam Sehnert
  • 2,933
  • 1
  • 20
  • 25
jelder
  • 2,220
  • 2
  • 19
  • 17
  • 2
    `AAAA` also works, in fact it is recommended by the AWS doc (step 7): https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-cloudfront-distribution.html – Mehran Apr 13 '18 at 19:06
  • 1
    Also, a CloudFront distribution won't appear if it's status is `In Progress`. Wait until it's `Deployed`. – Sam Sehnert Sep 01 '19 at 21:30
  • It's amazing this is not better documented in the CF Distribution setup doc. – qu1j0t3 May 14 '20 at 21:01
  • @Mehran That's incorrect. `AAAA` records are for IPv6 IPs. – ErikE Dec 07 '21 at 15:57
  • 4
    Number 2 was missing for me, thanks! – vargen_ Mar 11 '22 at 17:46
  • i bought both of my domain names on AWS, but when i add them to my cloudfront distribution im told to attach a certificate, i don't see where i can do that, i went to certificate manager, it doesn't allow me to create a certificate, for some obscure reason, all this is far too complicated, they have all the info they need – Martijn Scheffer Apr 13 '23 at 23:49
81

Make sure you have set one or more Alternate Domain Names for you distribution, otherwise it won't be listed on the target combo for Route53 Alias.

As far as I understand, that's the same as configuring ServerAlias on your Apache's VirtualHost (or the correspondent for Nginx and so on). Without it, your requests wouldn't be identified as destined to that distribution when it gets there.

From AWS's documentation:

If you're using CloudFront to distribute your content, you can use Amazon Route 53 to route queries to your CloudFront distribution. The name of your Amazon Route 53 hosted zone (such as example.com) must match an alternate domain name in the CloudFront distribution. You cannot route queries to the CloudFront domain name for your distribution (such as d111111abcdef8.cloudfront.net). The following procedure assumes that you have already registered the applicable domain names.

Edson Marquezani Filho
  • 2,436
  • 1
  • 14
  • 18
41

Make sure it's an A record rather than a CNAME record (weird, I know). I found that buried in the documentation here:

http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-values-alias.html

Andrew Clark
  • 1,003
  • 9
  • 8
17

If your distribution does not show as an alias target, you can always manually copy and paste the d123.cloudfront.net (replace d123.cloudfront.net with the actual DNS name of your distribution) in to the target. This will allow you to create the alias record.

imperalix
  • 3,701
  • 1
  • 23
  • 19
  • The Route53 Management Console does not currently permit you to do this. You could make a CNAME instead, but it won't be an "alias" in the AWS sense. – jelder Mar 24 '16 at 14:11
  • jelder, it worked and still works for me every time. – imperalix Mar 29 '16 at 17:25
  • This works, as soon as you paste the CloudFront distribution URL in that box, AWS picks it up, and saves it. Thank you! – Herald Smit Jan 26 '18 at 10:48
7

Make sure your CloudFront distribution includes the name of your site (example.com )! I was having the same issue and spent well over an hour trying to solve the problem...

DonCarleone
  • 544
  • 11
  • 20
5

TL/DR

Set your Origin ID in the origin in your Cloudfront Distribution to be the same as the domain name you are trying to create an alias for

More Detail

I struggled with this for some time.

In the end I compared a working CloudFront distribution which did show up in Route 53 with one that did not.

What I noticed was that the Origin Id specified in the origin for the distribution was not the domain name for my site.

This option is found in: CloudFront Distributions > [Id of distribution] > Origins and Origin Groups > Origins.

I only had one origin listed where the path was the name of a public s3 bucket. This entry also had an Origin ID field. When I updated this to be my domain name (without the www prefix) e.g. testdomain.com then I was able to see this cloud front distribution in the route 53 alias drop down.

Remotec
  • 10,304
  • 25
  • 105
  • 147
5

You have to fill the Alternate Domain Names (CNAMEs) field e.g. use

www.my_site.com  
*.my_site.com

For SSL Certificate field select

Custom SSL Certificate (example.com)

for this you will have to create and verify your domain with ACM, ACM has to be created in Virginia.

After that you will be able to see the Cloudfront in R53.

unixeo
  • 1,116
  • 1
  • 15
  • 28
5

The trick was to enter the www before the domain because CloudFront matches against that alternate domain name with www or whatever subdomain you use. Type www or your subdomain and it will find the distribution.

cloudfront

Mihail Duchev
  • 4,691
  • 10
  • 25
  • 32
nate sire
  • 59
  • 1
  • 2
2

It was taking forever for my cloudfront distribution status property to read deployed.

However inputting the cloudfront domain url into my address bar brought me to my website, aka the cloudfront domain url was live.

Feeling impatient, I copied this domain address and pasted it into the alias target field.

It worked!

enter image description here enter image description here

learnAsWeGo
  • 2,252
  • 2
  • 13
  • 19
0

I wanted to point a subdomain to CloudFront. I added it here and it started showing CloudFront in Route53 having previously hidden it.

enter image description here

garryp
  • 5,508
  • 1
  • 29
  • 41