-
-
Save g3rhard/2845825cdb124ac484bea3b57bcb07de to your computer and use it in GitHub Desktop.
Download zone file in bind format from AWS Route53
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
#!/bin/bash | |
# download zone from AWS Route53 | |
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