Skip to content

Instantly share code, notes, and snippets.

@boombick
Last active January 17, 2019 16:39
Show Gist options
  • Select an option

  • Save boombick/a5495c758c16f4be1b4e4b973b990c09 to your computer and use it in GitHub Desktop.

Select an option

Save boombick/a5495c758c16f4be1b4e4b973b990c09 to your computer and use it in GitHub Desktop.
Dump route53 into zonefile
#!/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