Help us understand the problem. What is going on with this article?

AWSのIPアドレスの範囲をCSVで取得

More than 1 year has passed since last update.

正確には、AWSのIPアドレス範囲をjsonで取得したあと、jqコマンドでcsvに変換します。

AWSのIPアドレス範囲のjsonファイルのURLは、こちらから確認。
https://docs.aws.amazon.com/ja_jp/general/latest/gr/aws-ip-ranges.html

jqのインストール
sudo yum -y install epel-release
sudo yum -y install jq
CSVで出力
curl -s https://ip-ranges.amazonaws.com/ip-ranges.json |  \
jq -r '.prefixes[] |  [.ip_prefix, .region, .service] | @csv'
絞り込みしながら、CSVで出力(ap-northeaset-1(Tokyo)のS3に絞り込み)
curl -s https://ip-ranges.amazonaws.com/ip-ranges.json |  \
jq -r '.prefixes[] | select((.service == "S3" ) and (.region == "ap-northeast-1")) |  [.ip_prefix, .region, .service] | @csv'
PowerShellでCSV取得
 ((Invoke-Webrequest -uri  https://ip-ranges.amazonaws.com/ip-ranges.json).Content | ConvertFrom-Json ).prefixes | ConvertTo-CSV 
PowerShellで絞り込みながらCSV取得
 ((Invoke-Webrequest -uri  https://ip-ranges.amazonaws.com/ip-ranges.json).Content | ConvertFrom-Json ).prefixes | ConvertTo-CSV `
| Select-String "S3" | Select-String "ap-northeast-1"
fjtter
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした