~ 1 minutes read
Transferring a domain from one AWS account to another is possible via AWS API and AWS CLI. Recently I had to transfer a domain. I experienced three interesting cases using the AWS CLI (version 2.1.21):

route53domains AWS CLI call
The AWS CLI documentation: https://docs.aws.amazon.com/cli/latest/reference/route53domains/transfer-domain-to-another-aws-account.html does not contain an example like the one below unfortunately:
aws route53domains transfer-domain-to-another-aws-account \ --domain-name [yourdomain.com] \ --account-id [your_aws_account_id] \ --region us-east-1
AWS Region
Regardless which AWS region your services run in, the aws cli command
aws route53domains
requires always the region flag:
--region us-east-1
AWS R53 is a so called global service that requires this fixed region flag.
Accept transfer request with password flag
aws route53domains transfer-domain-to-another-aws-account \ --domain-name [yourdomain.com] \ --account-id [your_aws_account_id] \ --region us-east-1
produces an output like
{
"OperationId": "54f1a722-f7a6-4d6b-939a-124d5946dfa0",
"Password": "a8`U^u1a2d*pa;"
}
Within the target AWS account, you shall accept the domain transfer request.
aws accept-domain-transfer-from-another-aws-account \ --domain-name [yourdomain.com] \ --password "a8`U^u1a2d*pa;"
I could provide the password only via the CLI parameter
--password
and not via a json file using the parameter:
--cli-input-json
The documentation describes the behaviour very well. However I wish I could provide the json output of transfer-domain-to-another-aws-account as json input to accept-domain-transfer-from-another-aws-account.
Links
- https://medium.com/@chris_nagy/the-journey-of-transferring-a-domain-to-another-aws-account-10293f901cb5
- https://github.com/aws/aws-cli/issues/1354#issuecomment-686465465
- https://stackoverflow.com/questions/63418939/transfer-domain-from-one-aws-account-to-another-aws-account
- https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-transfer-between-aws-accounts.html#domain-transfer-between-aws-accounts-hosted-zone
- https://docs.aws.amazon.com/cli/latest/reference/route53domains/transfer-domain-to-another-aws-account.html
- https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_TransferDomainToAnotherAwsAccount.html
- https://docs.aws.amazon.com/cli/latest/reference/route53domains/accept-domain-transfer-from-another-aws-account.html
Leave a Reply