Skip to content

Instantly share code, notes, and snippets.

@amosshapira
Created June 29, 2016 00:44
Show Gist options
  • Save amosshapira/dae0ba71948993caa6800e9777e03487 to your computer and use it in GitHub Desktop.
Save amosshapira/dae0ba71948993caa6800e9777e03487 to your computer and use it in GitHub Desktop.
List all AZ's in all AWS regions
#!/bin/bash
aws ec2 describe-regions --query 'Regions[*].RegionName' --output text | \
tr '\t' '\n' | \
while read REGION
do
aws ec2 describe-availability-zones --region $REGION \
--query 'AvailabilityZones[*].{ZoneName:ZoneName,Region:RegionName}' \
--output text
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment