Skip to content

Instantly share code, notes, and snippets.

@mtilson
Created September 22, 2021 23:24
Show Gist options
  • Save mtilson/ce41b676217a349644ebe5c329568142 to your computer and use it in GitHub Desktop.
Save mtilson/ce41b676217a349644ebe5c329568142 to your computer and use it in GitHub Desktop.
how to list all route53 A records
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
/"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