Created
October 2, 2017 16:07
-
-
Save Technifocal/4163ec39986f8aea3c2d856eaf951fc9 to your computer and use it in GitHub Desktop.
List AWS spot instance prices and sort by price
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
#!/usr/bin/env bash | |
curl -s 'http://spot-price.s3.amazonaws.com/spot.js' | sed 's/callback(//g;s/)\;//g' | jq -r '[.config.regions[] | {region:.region, size:(.instanceTypes[].sizes[])}] | map("Price: \(.size.valueColumns[0].prices.USD). Size: \(.size.size). Region: \(.region).")|.[]' | grep -v 'N/A*' | sort -nrk2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment