Created
January 20, 2022 07:32
-
-
Save sasasin/8305c6aced89211c048db67ec04336b6 to your computer and use it in GitHub Desktop.
AWS Route 53 hosted zones 中身を全部出すやつ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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