jq

Table of Contents

jq

AWS Health Check IP を抜き出す

$ curl -s https://ip-ranges.amazonaws.com/ip-ranges.json |jq '.prefixes' | jq 'map(select(.["service"] == "ROUTE53_HEALTHCHECKS"))' | jq 'map(select(has("ip_prefix")))'  | jq '.[]."ip_prefix"'

Dynamoのテーブル定義を抜き出す

$ aws dynamodb describe-table --table-name hoge |  jq '.Table' | jq 'del(.TableSizeBytes)' | jq 'del(.TableStatus)' | jq 'del(.ProvisionedThroughput.NumberOfDecreasesToday)' | jq 'del(.ProvisionedThroughput.LastIncreaseDateTime)' | jq 'del(.ProvisionedThroughput.LastDecreaseDateTime)' | jq 'del(.CreationDateTime)' | jq 'del(.ItemCount)'  | jq 'del(.TableArn)' | jq 'del(.TableId)' > hoge.json

Validate