Created
September 18, 2018 13:01
-
-
Save jordiclariana/327497611513b4f3b95503baddb617f4 to your computer and use it in GitHub Desktop.
Dump all route53 zones and records
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 | |
| 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