Created
September 22, 2021 23:24
-
-
Save mtilson/ce41b676217a349644ebe5c329568142 to your computer and use it in GitHub Desktop.
how to list all route53 A records
This file contains 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
aws route53 list-hosted-zones | jq '.HostedZones[].Id' | tr -d '"' | while read zone ; do | |
echo "== $zone" | |
aws route53 list-resource-record-sets --hosted-zone-id $zone --query "ResourceRecordSets[?Type == 'A']" | \ | |
grep '"Name":\|DNSName\|Value' | \ | |
sed -e 's/ //g' | \ | |
sed -n -f route53.sed | |
done |
This file contains 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
/"Name"/ { | |
1h | |
1! { x; s/\n//g; p; d; } | |
} | |
/"DNSName"/ { | |
H; d; x; s/\n//; p; d | |
} | |
/"Value"/ { | |
$! {H; d;} | |
$ {H; g; s/\n//g; p; d; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment