Reputation: 7304
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
Upvotes: 128
Views: 59977
Reputation: 4101
Ok there is a chain of dependencies that exist that aren't well documented.
Do this in order:
Upvotes: 0
Reputation: 5766
I wanted to point a subdomain to CloudFront. I added it here and it started showing CloudFront in Route53 having previously hidden it.
Upvotes: 2
Reputation: 79
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.
Upvotes: 7
Reputation: 829
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...
Upvotes: 9
Reputation: 2272
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!
Upvotes: 2
Reputation: 1186
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.
Upvotes: 7
Reputation: 10758
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.
Upvotes: 6
Reputation: 2430
Combining several correct but incomplete answers:
A
records and AAAA
are supported. Not CNAME
records.something.example.com
, you should have already set the alternate domain name for one of your distributions to something.example.com
.Deployed
.Upvotes: 133
Reputation: 1123
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
Upvotes: 46
Reputation: 2696
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.
Upvotes: 94
Reputation: 3741
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.
Upvotes: 19