Skip to content

Instantly share code, notes, and snippets.

@tcarrondo
Created May 3, 2019 11:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tcarrondo/c2bb7ca6861cd5d02ca766f837d033ac to your computer and use it in GitHub Desktop.
Save tcarrondo/c2bb7ca6861cd5d02ca766f837d033ac to your computer and use it in GitHub Desktop.
#!/bin/bash
zonename=$1
profile=$2
hostedzoneid=$(aws route53 --profile=$profile list-hosted-zones | jq -r ".HostedZones[] | select(.Name == \"$zonename.\") | .Id" | cut -d'/' -f3)
aws route53 --profile=$profile 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