Skip to content

Instantly share code, notes, and snippets.

@sasasin
Created January 20, 2022 07:32
Show Gist options
  • Save sasasin/8305c6aced89211c048db67ec04336b6 to your computer and use it in GitHub Desktop.
Save sasasin/8305c6aced89211c048db67ec04336b6 to your computer and use it in GitHub Desktop.
AWS Route 53 hosted zones 中身を全部出すやつ
#!/bin/bash -e
aws route53 list-hosted-zones-by-name \
| jq -cr '.HostedZones[].Id' \
| sort \
| while read HOSTED_ZONE_ID; do
aws route53 list-resource-record-sets --hosted-zone-id ${HOSTED_ZONE_ID} \
| jq -r '.ResourceRecordSets[] | [.Name, .Type, (.ResourceRecords[]? | .Value), .AliasTarget.DNSName?] | @csv' \
| sort
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment