Created
November 30, 2015 06:06
-
-
Save amosshapira/780a6dc1ee67c7738c26 to your computer and use it in GitHub Desktop.
List all AWS regions and EC2 availability zones using AWS cli
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 | |
| # Uses jq to extract data from JSON | |
| aws ec2 describe-regions | \ | |
| jq -r '.Regions[] | .RegionName' | \ | |
| while read i | |
| do | |
| echo ==== $i ==== | |
| aws ec2 describe-availability-zones --region $i | \ | |
| jq -r '.AvailabilityZones[] | .ZoneName' | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment