LoginSignup
15
15

More than 5 years have passed since last update.

AWS CLIでインスタンスとEIP関連操作メモ

Last updated at Posted at 2016-08-13

VPC型じゃないほうのインスタンスを対象にした記事が多かったので自分用にメモ

instance_nameを含むインスタンスを検索

aws ec2 describe-instances --filter "Name=tag:Name,Values=*{instance_name}*"

新規Elastic IP発行

aws ec2 allocate-address --domain vpc

Elasitc IPをインスタンスに関連付け

aws ec2 associate-address --allocation-id {allocation-id} --instance {instance-id}

Elasitc IPの関連付けを外す

aws ec2 disassociate-address --association-id {association-id}

Elasitc IPを開放(消す)

aws ec2 release-address --allocation-id {allocation-id}

おまけ:ドキュメントに書いてあるけど動かない

aws ec2 describe-instances --filter "Name=association.allocation-id,Values={allocation-id}"

aws ec2 describe-instances --filter "Name=association.association-id,Values={association-id}"

aws ec2-describee addresses --public-ips {public_id}

15
15
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
15
15