LoginSignup
18
13

More than 5 years have passed since last update.

誤って解放したElastic IP(EIP)を復旧する

Last updated at Posted at 2017-12-20

オペミスでElastic IPアドレス(EIP)を解放できないように、IAMポリシーでElastic IP(EIP)の解放を許可しないという記事を以前書いたけど、復旧するコマンドがあったので、まとめておく。

Elastic IPアドレスの復旧ルール

以下のルールに沿えば、Elastic IPアドレスを解放した場合でも、復旧できる可能性がある。

  • もともと EC2-VPC で使用するために割り当てられていたか、EC2-Classic から EC2-VPC に移動された Elastic IPアドレスだけを復旧できる。
  • 他のAWSアカウントに割り当てられている場合は復旧できない。
  • Elastic IPアドレスの割当上限(AWSアカウント作成時のデフォルトでは5個)を超過する場合は、復旧できない。

ユーザーガイド(日本語版)では、以下のように記述されているが誤訳。

  • もともと EC2-VPC で使用するために割り当てられていたか、EC2-Classic から EC2-VPC に移動された Elastic IP アドレスを 復元することはできません。

(原文)ユーザーガイド(英語版)
You can only recover an Elastic IP address that was originally allocated for use in EC2-VPC, or that was moved from EC2-Classic to EC2-VPC.

オペレーション

# EIPを割り当てるコマンドに--addressオプションを付加して実行する
$ aws ec2 allocate-address --domain vpc --address 203.0.xx.yy

# 実行結果
{
    "PublicIp": "203.0.xx.yy",
    "Domain": "vpc",
    "AllocationId": "eipalloc-abcdefgh"
}

その他

運悪く、他所のAWSアカウントにEIPを割り当てられてしまった場合は復旧不可なので、誤って解放した事に気付いた時点で速やかに復旧する必要がありそう。

参考

Amazon Elastic Compute Cloud Linux インスタンス用ユーザーガイド - Elastic IP アドレスの復旧

18
13
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
18
13