Created
May 10, 2019 17:04
-
-
Save davidsayers/b7e887390671f382a2f89e45b075ef4e to your computer and use it in GitHub Desktop.
Generate a list of the AZs instance types can be launched in
This file contains 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 | |
instance_types=$(curl -s https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonEC2/current/index.json | jq -r '.products[].attributes["instanceType"]' | sort -u | grep '\.') | |
for instance in $instance_types; do | |
echo "$instance" | |
echo "----------" | |
aws ec2 describe-reserved-instances-offerings --filters 'Name=scope,Values=Availability Zone' --no-include-marketplace --instance-type "$instance" | jq -r '.ReservedInstancesOfferings[].AvailabilityZone' | sort | uniq | |
echo | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment