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