Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CloudFront distribution not showing as Route53 alias target

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

like image 333
LDJ Avatar asked Jun 03 '15 05:06

LDJ


People also ask

How do I connect CloudFront to Route 53?

Sign in to the AWS Management Console and open the Route 53 console at https://console.aws.amazon.com/route53/ . In the navigation pane, choose Hosted zones. Choose the linked name of the hosted zone for the domain that you want to use to route traffic to your CloudFront distribution. Choose Create record.

Can I use CloudFront as an A record with Route 53?

Route 53 is a DNS service whereas Cloudfront is CDN service to serve static (and dynamic) content. You can use the cloudfront with Route 53 Geolocation Routing .

How do I create an alias for CloudFront?

Create an alias recordCreate your record using the Route 53 console and specify the necessary values for alias records. Be sure to use the correct DNS record type for IP addresses in the service you're pointing to: Amazon CloudFront distribution – A record (IPv4) or AAAA record (IPv6)

Can you use CloudFront without Route 53?

Yes, it is possible to use a Cloudfront distribution using a registrar other than AWS without a Route53 public hosted zone. You don't need Cloudflare to do it. You can create an Alias record with the subdomain and target in your registrar's control panel. The target would be something like dabcxyz.cloudfront.net.


3 Answers

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.
like image 184
jelder Avatar answered Oct 22 '22 01:10

jelder


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.

like image 67
Edson Marquezani Filho Avatar answered Oct 21 '22 23:10

Edson Marquezani Filho


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

like image 39
Andrew Clark Avatar answered Oct 22 '22 01:10

Andrew Clark