![](/img/trans.png)
[英]Boto3 & moto - Route53 error creating dns record set, it can't find the hosted zone
[英]route53 transfer domain to another aws account
我正在尝试将我的域从一个 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)
除非您需要自动化或对多个域重复此过程,否则我建议您简单地使用Route53 管理控制台来转移域。
另一种选择是使用 aws cli:( 文档)
aws route53domains transfer-domain-to-another-aws-account --region us-east-1 --domain-name <value> --account-id <value>
至于您当前收到的错误,我怀疑您可能需要更新 boto3。
使用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>
执行命令以在目标帐户中接受该域,删除--cli-input-json
并使用此命令。
aws route53domains accept-domain-transfer-from-another-aws-account --domain-name <your-domain> --password "<your password>"
然后运行下面的命令确认域名是否已经转移
aws route53domains list-domains
过程发生了很大变化,但仍然很简单。
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 格式的 output,其操作 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
对于不来自 us-east-1 地区的每个人都在尝试执行此操作时偶然发现...
GitHub 上存在这个问题,今天仍未解决: https://github.com/aws/aws-cli/issues/1354
无论您的主要位置是什么,您都需要明确使用--region us-east-1
以使aws route53domains
命令正常工作。 否则你会看到 fe
Could not connect to the endpoint URL: "https://route53domains.eu-central-1.amazonaws.com/"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.