CloudFront distribution not showing as Route53 alias target

32,785

Solution 1

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.

Solution 2

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.

Solution 3

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

Solution 4

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.

Solution 5

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...

Share:
32,785

Related videos on Youtube

LDJ
Author by

LDJ

Updated on November 09, 2020

Comments

  • LDJ
    LDJ over 3 years

    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

    • Michael - sqlbot
      Michael - sqlbot almost 9 years
      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?"
    • boldnik
      boldnik about 5 years
      This article describes it: the alternate domain name (CNAME) should be not empty to be visible in the dropdown for A-record alias.
    • qu1j0t3
      qu1j0t3 almost 4 years
      @Michael-sqlbot I also had to refresh the Route53 page to see it.
    • CodeDoctorJL
      CodeDoctorJL over 3 years
      i changed my cloudfront security policy to TLSv1.1_2016 and it resolve this issue for me
  • jelder
    jelder about 8 years
    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.
  • imperalix
    imperalix about 8 years
    jelder, it worked and still works for me every time.
  • Moataz Elmasry
    Moataz Elmasry almost 8 years
    THIS IS THE CORRECT ANSWER
  • Dean Oakley
    Dean Oakley over 7 years
    Thanks, that fixed it for me.
  • Rudiger
    Rudiger almost 7 years
    Although correct AWS should really fix up at the very least wording. In the distribution settings it asks to specify the CNAMEs however route 53 must be set to an A record for it to work.
  • Gobi Dasu
    Gobi Dasu almost 7 years
    Can you please link to the documentation?
  • Carsten
    Carsten over 6 years
  • Herald Smit
    Herald Smit over 6 years
    This works, as soon as you paste the CloudFront distribution URL in that box, AWS picks it up, and saves it. Thank you!
  • Mehran
    Mehran about 6 years
    AAAA also works, in fact it is recommended by the AWS doc (step 7): docs.aws.amazon.com/Route53/latest/DeveloperGuide/…
  • bad robot
    bad robot almost 5 years
    this was my issue
  • Sam Sehnert
    Sam Sehnert over 4 years
    Also, a CloudFront distribution won't appear if it's status is In Progress. Wait until it's Deployed.
  • dmitrybelyakov
    dmitrybelyakov over 4 years
    Thanks Andrew. This was very confusing.
  • Ajeesh Joshy
    Ajeesh Joshy almost 4 years
    This worked for me while adding a wild card subdomain.
  • qu1j0t3
    qu1j0t3 almost 4 years
    It's amazing this is not better documented in the CF Distribution setup doc.
  • Andreas
    Andreas almost 3 years
    Thanks, that helped!
  • Abdennour TOUMI
    Abdennour TOUMI almost 3 years
    😂 we become putting workarounds to some bugs :)
  • Abdennour TOUMI
    Abdennour TOUMI almost 3 years
    but how come you are able to select regions for cloudfront ?? cloudfront is always in us-east-1
  • ErikE
    ErikE over 2 years
    @Mehran That's incorrect. AAAA records are for IPv6 IPs.
  • Juan Rangel
    Juan Rangel over 2 years
    This worked for me. I had to add my domain to the alternate domain names. Thanks!
  • strangeMethod
    strangeMethod about 2 years
    This was also my issue, thanks.
  • vargen_
    vargen_ about 2 years
    Number 2 was missing for me, thanks!