如何使用GCP Cloud Run应用程序在AWS Route53中映射域 [英] How to map domain in AWS Route53 with GCP Cloud Run app

查看:72
本文介绍了如何使用GCP Cloud Run应用程序在AWS Route53中映射域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的域在Route 53中注册.我们有1个托管区域,并且该域当前用于我们的EC2实例之一(我认为是弹性IP地址).我们的托管区域具有使用我们的EC2实例所需的所有记录.现在,对于通过GCP的Cloud Run部署的应用程序,我们需要使用此域.我已前往 console.cloud.google.com/run/domains 并单击添加映射,输入我们的基本网址,并收到一个按钮,用于验证我单击的网站站长中心,通过此下拉菜单将我带到该Google页面(在下面的图片中,我将网址更改为假域 mydomain.com ):

Our domain is registered in Route 53. We have 1 hosted zone, and the domain is currently used for one of our EC2 instances (I think as an elastic IP address). Our hosted zone has all of the records needed to work with our EC2 instance. We now need to use this domain instead for my an application deployed through GCP's Cloud Run. I have headed to console.cloud.google.com/run/domains and clicked Add Mapping, typed in our base url, and received a button to Verify in Webmaster Central, which I click, bringing me to this google page with this dropdown (in the images below I changed my url to the fake domain mydomain.com):

此下拉列表没有 Route53 Amazon Registrar 作为选项,我不确定要选择什么其他选项.底部是 Other (其他),它将打开以下菜单:

This dropdown does not have Route53 or Amazon Registrar as an option, and I'm not sure what other option to choose. At the bottom is Other, which opens up the following menu:

对于第1步,我正在苦苦挣扎.我已登录我的AWS账户,转到Route 53,并为 mydomain.com :

For step 1, I am struggling. I have logged into my AWS account, went to Route 53, and created a new hosted zone for mydomain.com:

我单击 mydomain.com 的新托管区域,单击创建记录,为策略选择简单路由(共有6个选项:简单路由",加权",地理位置",延迟",故障转移",多值答案"),然后单击定义简单记录",并发送到此页面:

I click on the new hosted zone for mydomain.com, click create record, choose Simple Routing for the policy (there were 6 options: Simple Routing, Weighted, Geolocation, Latency, Failover, Multivalue answer), then click Define Simple Record, and get sent to this page:

我将记录名称留空,将记录类型"设置为TXT,根据记录类型选择 IP地址或其他值,然后将该行从google网站管理员验证页复制/粘贴到输入字段.我点击定义简单记录以创建记录.

I left the record name blank, set the Record Type to TXT, selected IP address or another value depending on the record type, and copy/pasted the line from the google webmaster verification page into the input field. They I click Define Simple Record to create the record.

不幸的是,所有这些之后,无法从Google网站站长验证页面进行验证.为了确认这一点,当我单击验证时,我会收到以下错误通知:

Unfortunately, after all of this, the verification is not successful from the Google Webmaster verification page. To confirm this, I am receiving the following error notification when I click Verify:

也许将域从Route 53迁移到Google的DNS会更容易,尽管在我看来,将域保留在AWS中并简单地将许可授予Cloud Run应用程序即可使用该域.对于拥有Cloud Run中的应用程序和AWS Route 53中的域的任何人来说,这似乎都是一个问题.

Perhaps moving the domain from Route 53 to Google's DNS would be easier, although to me it seems simpler to leave the domain in AWS and simply give permission to the Cloud Run app to use the domain. This seems like it would be an issue for anybody with an app in Cloud Run and a domain in AWS Route 53.

当我从命令行运行 dig TXT mydomain.com 时,我得到的内容如下所示(数字已编辑):

When I run dig TXT mydomain.com from the command line, I get something that looks like this (numbers edited):

MyComputer-1:Documents myname$ dig TXT mydomain.com

; <<>> DiG 9.10.6 <<>> TXT mydomain.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 26912
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;cbbanalytics.com.              IN      TXT

;; AUTHORITY SECTION:
mydomain.com.       900     IN      SOA     ns-923.awsdns-18.com. awsdns-hostmaster.amazon.com. 1 5740 300 1204600 86210

;; Query time: 87 msec
;; SERVER: 6300:1004:dc40:4b00::1#53(2600:1400:dc40:4b00::1)
;; WHEN: Thu Sep 24 11:14:11 PDT 2020
;; MSG SIZE  rcvd: 123

Nicholass-MBP-5:Documents nicholas$ 

推荐答案

(代表问题作者发布的解决方案,将其移至答案部分).

根据评论中的建议,我删除了第二个托管区域,在第一个托管区域中创建了TXT记录(与上面的屏幕快照相同),并且验证有效.

Per suggestion in the comments, I deleted the 2nd hosted zone, created the TXT record in the 1st hosted zone (in the same way as done in the screenshot above), and the verification worked.

这篇关于如何使用GCP Cloud Run应用程序在AWS Route53中映射域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆