LoginSignup
3
3

More than 5 years have passed since last update.

httpieを使った、AWSが利用しているIPアドレス取得コマンド

Last updated at Posted at 2014-11-26

AWSが利用しているIPアドレスを取り出してみたを参考に、普段私が使っているhttpieだとどうやるか書いてみました。

コマンド例

  • 全てのリージョンのレンジIPを取得

Serviceには、現在以下の項目が入ります。これ以外は順次追加されていくそうです。

  • "AMAZON"
  • "EC2"
  • "ROUTE53"
  • "ROUTE53_HEALTHCHECKS"
  • "CLOUDFRONT"
http https://ip-ranges.amazonaws.com/ip-ranges.json | jq '.prefixes[] | if .service == " INPUT SEVICE KEY " then .ip_prefix else empty end'
  • 指定のサービス&リージョンのレンジIPを取得

ここでは、東京リージョンのEC2で使用しているIPアドレスを取得します。

http https://ip-ranges.amazonaws.com/ip-ranges.json | jq '.prefixes[] | if .service == "EC2" and .region == "ap-northeast-1" then .ip_prefix else empty end'
3
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
3
3