简体   繁体   English

如何将具有自定义域名的 API 网关迁移到另一个 AWS 账户?

[英]How to migrate an API Gateway with a custom domain name to another AWS account?

I have an API gateway with a custom domain name ( foo.mycompany.com ).我有一个带有自定义域名 ( foo.mycompany.com ) 的 API 网关。

foo.mycompany.com belongs to the production environment, ie, there is traffic coming from the customers of the service almost every minute. foo.mycompany.com属于生产环境,即几乎每分钟都有来自服务客户的流量。

How can I migrate foo.mycompany.com to another AWS account without causing any downtime for the service?如何将foo.mycompany.com迁移到另一个 AWS 账户而不导致服务停机?

When I create the foo.mycompany.com custom domain name in the AWS console of the new AWS account, I got The domain name you provided already exists.当我在新建 AWS 账户的 AWS 控制台中创建foo.mycompany.com自定义域名时,我得到The domain name you provided already exists. error.错误。

在此处输入图像描述

Unfortunately it is not possible at the moment.不幸的是,目前这是不可能的。 I run a couple of API GW for high load clients and all had the same issue when migrating to new AWS accounts.我为高负载客户端运行了几个 API GW,并且在迁移到新的 AWS 账户时都遇到了同样的问题。 We even reached to AWS specialists.我们甚至联系了 AWS 专家。 The answer was :答案是:

  1. Delete custom domain name in OLD account删除旧账户中的自定义域名
  2. Add custom domain in new account在新帐户中添加自定义域

This of course means downtime.这当然意味着停机。 If someone else finds a blue-green migration possibility for these - I would like to know too.如果其他人为这些找到了蓝绿色迁移的可能性 - 我也想知道。

This works perfectly if you move to different region.如果您搬到不同的地区,这将非常有效。 The flow I used was我使用的流程是

  • switch api domain to edge将 api 域切换到边缘
  • create infrastructure in another region在另一个地区创建基础设施
  • switch DNS to that other region - custom domain was already created there.将 DNS 切换到其他区域 - 自定义域已在那里创建。

Unfortunately, custom API domain has to be unique in a region.不幸的是,自定义 API 域在一个地区必须是唯一的。

I am in similar situation as you now and I am trying to figure out solution.我现在和你的情况差不多,我正在想办法解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM