8
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AWSが利用しているIPアドレスを取り出してみた

Posted at

#AWSのIPアドレスレンジ

先日、JSONが提供されたのでjqで引っ張ってみた。

Amazon Web Services ブログ
AWSのIPアドレスレンジをJSONで提供
http://aws.typepad.com/aws_japan/2014/11/aws-cidr-json.html

"AMAZON", "EC2", "ROUTE53", "ROUTE53_HEALTHCHECKS", "CLOUDFRONT"が提供されています。

##IP取り出し

CloudFrontのIPレンジ

 curl https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '.prefixes[] | if .service == "CLOUDFRONT" then .ip_prefix else empty end'
205.251.254.0/24
54.239.192.0/19
204.246.176.0/20
54.230.0.0/16
205.251.250.0/23
205.251.192.0/19
216.137.32.0/19
204.246.164.0/22
205.251.249.0/24
54.192.0.0/16
54.239.128.0/18
54.240.128.0/18
204.246.174.0/23
204.246.168.0/22
205.251.252.0/23
54.182.0.0/16

EC2で尚且つ東京リージョン

 curl https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '.prefixes[] | if .service == "EC2" then . else empty end' | jq -r '. | if .region == "ap-northeast-1" then .ip_prefix else empty end'
54.238.0.0/16
54.64.0.0/15
54.250.0.0/16
175.41.192.0/18
54.199.0.0/16
176.34.32.0/19
46.51.224.0/19
54.248.0.0/15
54.150.0.0/16
54.178.0.0/16
54.92.0.0/17
176.32.64.0/19
176.34.0.0/19
54.168.0.0/16
54.95.0.0/16
103.4.8.0/21

##etc

バケットポリシーやELBのセキュリティグループ等活用する機会はありそう。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?