简体   繁体   English

route53 转移域名到另一个aws账户

[英]route53 transfer domain to another aws account

I am trying to transfer my domain from one AWS account to another AWS account.我正在尝试将我的域从一个 AWS 账户转移到另一个 AWS 账户。 I have tried boto3 SDK Route53domains client as given here: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/route53domains.html#Route53Domains.Client.transfer_domain_to_another_aws_account but my code returns this error: 'Route53Domains' object has no attribute 'transfer_domain_to_another_aws_account' .我已经尝试了 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' How do i try to transfer my domain other than contacting AWS Support.除了联系 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)

Unless you have a need to automate or repeat this procedure with many domains, I would recommend that you simply use the Route53 Management Console to transfer the domain.除非您需要自动化或对多个域重复此过程,否则我建议您简单地使用Route53 管理控制台来转移域。

Another option is to use the aws cli: ( documentation )另一种选择是使用 aws cli:( 文档

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

As for the error you are currently receiving, I suspect that you may need to update boto3.至于您当前收到的错误,我怀疑您可能需要更新 boto3。

Transfer the domain with the transfer-domain-to-another-aws-account AWS API as shown below使用transfer-domain-to-another-aws-account AWS API 转移域,如下所示

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

Executing the command to accept that domain in the destination account, remove the --cli-input-json and use this command.执行命令以在目标帐户中接受该域,删除--cli-input-json并使用此命令。

aws route53domains accept-domain-transfer-from-another-aws-account --domain-name <your-domain> --password "<your password>"

Then run the command below to confirm whether the domain has been transfered然后运行下面的命令确认域名是否已经转移

aws route53domains list-domains

The process has changed a lot but it is still simple.过程发生了很大变化,但仍然很简单。

There is no option on AWS Console to transfer domains between AWS accounts. AWS 控制台上没有在 AWS 账户之间转移域的选项。 The only domain transfer you can do on the console is to bring it from outside the purview of AWS Route53 like GoDaddy.com or Google Domains into AWS.您可以在控制台上进行的唯一域转移是将其从 AWS Route53 的范围之外(如 GoDaddy.com 或 Google Domains)带入 AWS。

However, you can do the transfer by yourself using the CLI option.但是,您可以使用 CLI 选项自行进行传输。 To do this, you must ensure that you have aws-cli 2.09 at least.为此,您必须确保至少拥有 aws-cli 2.09。 If yes, then follow the steps using the cli to transfer from 1 AWS account into another one:-如果是,请按照以下步骤使用 cli 从 1 个 AWS 账户转移到另一个账户:-

Step 1: Using old account IAM cli credentials, check if you can see your domains or not by aws route53domains list-domains .第 1 步:使用旧账户 IAM cli 凭证,通过aws route53domains list-domains检查您是否可以看到您的域。 Then initiate the domain transfer using the below command:-然后使用以下命令启动域转移:-

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

Step 2: From above step, you will get an output in a JSON format with operationid and password like:-第 2 步:从上述步骤中,您将获得 JSON 格式的 output,其操作 ID 和密码如下:-

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

Change that OperationId to DomainName and store it in a new JSON file along with the password like below:-将该 OperationId 更改为 DomainName 并将其与如下密码一起存储在新的 JSON 文件中:-

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

Step 3: Execute the last command to accept that domain using the IAM CLI credentials of your destination AWS account or profile like below:-第 3 步:使用您的目标 AWS 账户或配置文件的 IAM CLI 凭证执行最后一个命令以接受该域,如下所示:-

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

Step 4: Done:) Just execute that list-domains command again using new account CLI credentials and you will see your domain moved and listed here:-第 4 步:完成:) 只需使用新帐户 CLI 凭据再次执行该 list-domains 命令,您将看到您的域已移动并在此处列出:-

aws route53domains list-domains

For everyone stumbling across the thread who is not from us-east-1 region trying to do this...对于不来自 us-east-1 地区的每个人都在尝试执行此操作时偶然发现...

There is this issue on GitHub which is still not resolved today: https://github.com/aws/aws-cli/issues/1354 GitHub 上存在这个问题,今天仍未解决: https://github.com/aws/aws-cli/issues/1354

No matter what your main location is you need to explicitly use --region us-east-1 for the aws route53domains commands to work.无论您的主要位置是什么,您都需要明确使用--region us-east-1以使aws route53domains命令正常工作。 Else you will be presented with fe否则你会看到 fe

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

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

相关问题 Boto3和Moto-创建DNS记录集的Route53错误,找不到托管区域 - Boto3 & moto - Route53 error creating dns record set, it can't find the hosted zone 如何将数据从一条路线传输到烧瓶中的另一条路线 - how to transfer data from one route to another in flask 使用AWS Lambda中的Boto3将一个帐户中的S3存储桶复制到另一个帐户中的S3存储桶 - Copy from S3 bucket in one account to S3 bucket in another account using Boto3 in AWS Lambda 如何在python中实现帐户类的转账方法 - How to implement transfer method for a account class in python 如何使用AWS Certificate Manager验证域 - How to validate domain with AWS certificate manager 无法授权我的服务帐户使用域共享联系人 API - Cannot Authorize my Service Account to use the Domain Shared contacts API 使用AWS Glue在S3存储桶中传输文件 - Transfer files within S3 buckets using AWS Glue 从 Lambda 向 SQS 发送跨 AWS 账户消息 - Send cross AWS account message from Lambda to SQS 无论资源类型如何,如何获取 AWS 账户中的所有资源 - how to get all the resources in an AWS account irrespective of the resource type 运行 AWS Lambda function 以跨账户核对证书 - Run AWS Lambda function to collate certs cross account
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM