Created
May 21, 2025 17:26
-
-
Save lordjabez/28401558ec8c184849c6c7f853fa1e31 to your computer and use it in GitHub Desktop.
Create a zonefile from Route53
This file contains hidden or 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 | |
| hosted_zone_name="$1" | |
| hosted_zone_id=$(aws route53 list-hosted-zones --output text --query "HostedZones[?Name==\`$hosted_zone_name.\`].Id") | |
| aws route53 list-resource-record-sets --hosted-zone-id "$hosted_zone_id" --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