Skip to content

Instantly share code, notes, and snippets.

@cliffano
Last active September 13, 2023 13:45
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 cliffano/41c9eb97c06e5ca7fab64f6413f743a4 to your computer and use it in GitHub Desktop.
Save cliffano/41c9eb97c06e5ca7fab64f6413f743a4 to your computer and use it in GitHub Desktop.
List all Route53 records across all hosted zones using multiple AWS profiles.
#!/bin/bash
AWS_PROFILES="profile1 profile2"
for aws_profile in ${AWS_PROFILES}; do
export AWS_PROFILE=${aws_profile}
for zone in `aws route53 list-hosted-zones | jq -r '.HostedZones[].Id'`; do
aws route53 list-resource-record-sets --hosted-zone-id $zone |
jq -r '.ResourceRecordSets[]? | "\(.Name),\(.Type),\(.ResourceRecords[]?.Value)"';
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment