Last active
January 17, 2019 16:39
-
-
Save boombick/a5495c758c16f4be1b4e4b973b990c09 to your computer and use it in GitHub Desktop.
Dump route53 into zonefile
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 | |
| zonename=$1 | |
| hostedzoneid=$(aws route53 list-hosted-zones | jq -r ".HostedZones[] | select(.Name == \"$zonename.\") | .Id" | cut -d'/' -f3) | |
| aws route53 list-resource-record-sets --hosted-zone-id $hostedzoneid --output json | jq -jr '.ResourceRecordSets[] | "\(.Name) \t\(.TTL) \t\(.Type) \t\(.ResourceRecords[].Value)\n"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment