7
3

More than 1 year has passed since last update.

AWSのサブネット一覧と使用中IP一覧を見るコマンドラインツールを作った

Posted at

AWSの環境内にあるVPCとサブネットの一覧、そしてその中にあるIP一覧をコマンドラインで見るツールを作りました。

image.png

Python製です。boto3でAWSのリソースを見にいっています。

インストール

$ pip install aws-list-subnets

使い方

使い方はコマンド名を打つだけです。これで上のスクショのような表示がされます。

$ aws-list-subnets

AWSのprofileが複数あるならawscliと同じくオプションで指定します。

$ aws-list-subnets --profile PROFILE_NAME

--simple を付けると、使用中のIP一覧表示が省略されます。

$ aws-list-subnets --simple

-v を付けると、IPごとの詳細情報が表示されます。1行が長くて折り返されてしまい見づらいので --color | less -SR を付けたほうがよいです。aws-list-subnetsコマンドの出力をリダイレクトやパイプにするとカラー表示されなくなりますが、 --color を付けると強制的に色が付きます。

$ aws-list-subnets -v --color | less -SR
7
3
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
7
3