CloudFront distribution not showing as Route53 alias target

拟墨画扇 提交于 2020-02-26 08:47:36

问题


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


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



回答2:


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




回答3:


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.




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




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




回答6:


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.




回答7:


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!



来源:https://stackoverflow.com/questions/30611917/cloudfront-distribution-not-showing-as-route53-alias-target

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!