Skip to content

Instantly share code, notes, and snippets.

@wellsie
Forked from rfletcher/az.bash
Created February 7, 2016 15:26
Show Gist options
  • Save wellsie/031a882c6ee9d02a101a to your computer and use it in GitHub Desktop.
Save wellsie/031a882c6ee9d02a101a to your computer and use it in GitHub Desktop.
List all AWS availability zones
# List all AWS availability zones
#
# Depends on:
# - `aws`: https://aws.amazon.com/cli/ (installed and configured with credentials)
# - `jq`: https://stedolan.github.io/jq/
#
for REGION in $(
aws ec2 describe-regions | jq --raw-output '.Regions | map(.RegionName) | .[]' | sort
); do
aws ec2 describe-availability-zones --region "$REGION" |
jq --raw-output '.AvailabilityZones | map(.ZoneName) | .[]' |
sort
echo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment