【问题标题】:route53 transfer domain to another aws accountroute53 将域转移到另一个 aws 帐户
【发布时间】:2020-10-28 07:17:38
【问题描述】:

我正在尝试将我的域从一个 AWS 账户转移到另一个 AWS 账户。我已经尝试过这里给出的 boto3 SDK Route53domains 客户端:https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/route53domains.html#Route53Domains.Client.transfer_domain_to_another_aws_account 但我的代码返回了这个错误: 'Route53Domains' object has no attribute 'transfer_domain_to_another_aws_account'。除了联系 AWS Support 之外,我如何尝试转移我的域。

import boto3


client = boto3.client('route53domains')

if __name__ == "__main__":
    response = client.transfer_domain_to_another_aws_account(
                DomainName='domain.com',
                AccountId='MY_ACCOUNT_ID'
            )
    print(response)

【问题讨论】:

    标签: python-3.x amazon-web-services boto3 amazon-route53


    【解决方案1】:

    对于不来自 us-east-1 地区的每个人都在尝试执行此操作时遇到问题...

    GitHub上有这个问题今天仍未解决:https://github.com/aws/aws-cli/issues/1354

    无论您的主要位置是什么,您都需要明确使用--region us-east-1 才能使aws route53domains 命令正常工作。否则你会看到 f.e.

    Could not connect to the endpoint URL: "https://route53domains.eu-central-1.amazonaws.com/"

    【讨论】:

      【解决方案2】:

      过程发生了很大变化,但仍然很简单。

      AWS 控制台上没有在 AWS 账户之间转移域的选项。您可以在控制台上进行的唯一域转移是将其从 AWS Route53 范围之外(如 GoDaddy.com 或 Google Domains)转移到 AWS。

      但是,您可以使用 CLI 选项自行进行传输。为此,您必须确保至少拥有 aws-cli 2.09。如果是,请按照以下步骤使用 cli 从 1 个 AWS 账户转移到另一个账户:-

      第 1 步:使用旧帐户 IAM cli 凭证,检查您是否可以通过 aws route53domains list-domains 查看您的域。然后使用以下命令启动域转移:-

      aws route53domains transfer-domain-to-another-aws-account --domain-name <your domain name> --account-id <destination AWS account id>
      

      第 2 步:从上述步骤中,您将获得 JSON 格式的输出,其中包含操作 ID 和密码,例如:-

      {
          "OperationId": "c837dj8-5eae-29334-ah72-hs873ns8282",
          "Password": "ZKAHD\\WE.4LK\\US"
      }
      

      将该 OperationId 更改为 DomainName 并将其与密码一起存储在一个新的 JSON 文件中,如下所示:-

      {
          "Password": "ZKAHD\\WE.4LK\\US",
          "DomainName": "example.com"
      }
      

      第 3 步:使用您的目标 AWS 账户或配置文件的 IAM CLI 凭证执行最后一个命令以接受该域,如下所示:-

      aws route53domains accept-domain-transfer-from-another-aws-account --cli-input-json file://acceptDomainTransfer.json --profile gsp
      

      第 4 步:完成 :) 只需使用新帐户 CLI 凭据再次执行该 list-domains 命令,您就会看到您的域已移动并在此处列出:-

      aws route53domains list-domains
      

      【讨论】:

        【解决方案3】:

        除非您需要对多个域自动执行或重复此过程,否则我建议您只需使用 Route53 Management Console 来转移域。

        另一种选择是使用 aws cli:(documentation)

        aws route53domains transfer-domain-to-another-aws-account --region us-east-1 --domain-name <value> --account-id <value>
        

        至于您目前收到的错误,我怀疑您可能需要更新boto3。

        【讨论】:

        • Route53 控制台是否可以选择将域从一个 AWS 账户转移到另一个账户?我从来没有找到它。
        • 我不必亲自在帐户之间转移域名,但我认为这是可能的。我还想到了 AWS cli,如果 boto3 一直出现问题,这可能是一个更好的选择。我刚刚使用 aws cli 命令更新了答案。祝你好运!
        • 我发现你需要在us-east-1区域(即:--region=us-east-1)运行这个命令。
        猜你喜欢
        • 2018-07-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-09-01
        • 2016-09-18
        • 2016-03-26
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多