Skip to content

Instantly share code, notes, and snippets.

@Gabriellpweb
Last active May 4, 2018 17:08
Show Gist options
  • Save Gabriellpweb/e58901a0e183214ddf74e54e989a2f75 to your computer and use it in GitHub Desktop.
Save Gabriellpweb/e58901a0e183214ddf74e54e989a2f75 to your computer and use it in GitHub Desktop.
List Route53 hosted zones
#!/bin/bash
# USAGE: route53ls
#
# OUTPUTS:
#
# Id |Domain |Records
# s/hostedzone/XXXXXXXXXXXXXX |mywebsite.com |5s
aws route53 list-hosted-zones \
| jq '.HostedZones[] | "\(.Id) \(.Name) \(.ResourceRecordSetCount)"' \
| column -t -N 'Id,Domain,Records' -o ' |' \
| sed -e 's/\"/\s/g'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment