AWSアカウント間でEIPを移行する方法

はじめに

Amazon Virtual Private Cloud (VPC) now supports the transfer of Elastic IP addresses between AWS accounts

https://aws.amazon.com/jp/about-aws/whats-new/2022/10/amazon-virtual-private-cloud-vpc-transfer-elastic-ip-addresses-between-aws-accounts/

EIPがアカウント間で転送できるようになりました。

これにより、既存環境から新規アカウントへ移行させたい場合などに振り直しとなっていたEIPが、現状のまま使えるようになります。

公式の方法はこちら Transfer Elastic IP addresses

こちらを試してみたいと思います。

手順

転送元アカウント作業

EC2-EIPから送りたいEIPをクリック、「アクション」→「Enable transfer」を選択

「Transfer account ID」へ送り先のアカウントIDを入力。「enable」を最後に入力

これで転送元アカウントでの作業は完了です。

転送先アカウント作業

EC2-EIPからEIPを選択せず「アクション」→「Accept transfers」を選択

Addressesへ、EIPアドレスを記入。

転送されました。簡単ですね!!

注意事項

EIPが既に関連付けられていたり、逆引き設定が入っていると転送できません。 そのため、単体構成のServerなどで移動したい場合には先に解除が必要となるため、公開Serverの場合にはメンテナンス時間が必要になります。

InvalidTransfer.AddressCustomPtrSet: If you or someone in your organization has configured the Elastic IP address that you are attempting to transfer to use reverse DNS lookup, the source account can enable transfer for the Elastic IP address, but this exception occurs when the transfer account tries to accept the transfer. To resolve this issue, the source account must remove the DNS record for the Elastic IP address. For more information, see Remove a reverse DNS record in the Amazon EC2 User Guide for Linux Instances.

InvalidTransfer.AddressAssociated: If an Elastic IP address is associated with an ENI or EC2 instance, the source account can enable transfer for the Elastic IP address, but this exception occurs when the transfer account tries to accept the transfer. To resolve this issue, the source account must disassociate the Elastic IP address. For more information, see Disassociate an Elastic IP address in the Amazon EC2 User Guide for Linux Instances.

とはいえ、レコード変更やら、別サーバーとの連携部分がEIP指定の場合、書き換えないでいいのは助かります。