Created
January 10, 2020 17:53
-
-
Save mausch/7834888398af8bac39277fcecb394389 to your computer and use it in GitHub Desktop.
Get current EC2 spot prices in your region
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
# thanks to https://stackoverflow.com/a/32967407 for the CSV output | |
aws ec2 describe-spot-price-history --product-description "Linux/UNIX (Amazon VPC)" --start-time "$(date +%s)" | jq '.SpotPriceHistory | group_by(.InstanceType) | [.[] | min | {InstanceType, SpotPrice}]' | jq -r '(.[0] | keys_unsorted) as $keys | $keys, map([.[ $keys[] ]])[] | @csv' | less |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment