LoginSignup
3
2

More than 3 years have passed since last update.

AWSアカウント間のドメイン移管はAWSサポートを使わずawscliだけでできるようになった

Last updated at Posted at 2020-06-24

タイトルの通り。

概要

AWSの別アカウントにドメインを移行する際、AWSサポートを使わないとできないという印象があり、面倒だなとずっと思っていた。

が、今ドキュメントを見るとawscliで普通にできるようになってた。

実践

移管元のAWSアカウントを 111111111111
移管先のAWSアカウントを 222222222222
とする。

移管元

移管元のアカウントで「ドメイン転送するよ!」のコマンドを打つ。
awscliで transfer-domain-to-another-aws-account を実行すればよい。

# user is 111111111111
aws route53domains transfer-domain-to-another-aws-account --domain-name mogemoge.com --account-id 222222222222

戻り値にパスワードが返って来るので Password を覚えておく。

{
    "OperationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx",
    "Password": "password"
}

移管先

移管先のアカウントで「受け取るよ!」のコマンドを打つ。
awscliで accept-domain-transfer-from-another-aws-account を実行すればよい。

# user is 222222222222
aws route53domains accept-domain-transfer-from-another-aws-account --domain-name mogemoge.com --password 上記で取得したパスワード

注意点

通常のドメイン手続きを一切しないで上記コマンドを2回だけ打つこと

普通のドメイン転送の手続きをやって「あれーできないーー」となっていたものの、AWSアカウント同士の移管は上記のコマンドを打つ特別なオペレーションというわけでした。

Could not connect to the endpoint URL: "https://route53domains.ap-northeast-1.amazonaws.com/" とか言われる

route53はグローバルサービスなのでawscliの引数に --region us-east-1 を加えましょう。

参照

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2