Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if [[ -z $1 ]]; then
- echo "Usage: $0 <hosted_zone_domain>"
- exit 1
- fi
- if [[ -z $AWS_PROFILE ]]; then
- echo "Please, export AWS_PROFILE"
- exit 1
- fi
- 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"'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement