-
-
Save wellsie/031a882c6ee9d02a101a to your computer and use it in GitHub Desktop.
List all AWS availability zones
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
# 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