Skip to content

Instantly share code, notes, and snippets.

@jordiclariana
Created September 18, 2018 13:01
Show Gist options
  • Save jordiclariana/327497611513b4f3b95503baddb617f4 to your computer and use it in GitHub Desktop.
Save jordiclariana/327497611513b4f3b95503baddb617f4 to your computer and use it in GitHub Desktop.
Dump all route53 zones and records
#!/bin/bash
aws route53 list-hosted-zones | jq -r '.HostedZones[] | (.Name + " " + .Id)' | while read -r domain zoneid; do
echo -e "\n======================\n## $domain - $zoneid\n"
aws route53 list-resource-record-sets --hosted-zone-id "$zoneid" | \
jq -r '.ResourceRecordSets[] | [.Name, .Type, (.ResourceRecords[]? | .Value), .AliasTarget.DNSName?] | @tsv'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment