Skip to content

Instantly share code, notes, and snippets.

@Technifocal
Created October 2, 2017 16:07
Show Gist options
  • Save Technifocal/4163ec39986f8aea3c2d856eaf951fc9 to your computer and use it in GitHub Desktop.
Save Technifocal/4163ec39986f8aea3c2d856eaf951fc9 to your computer and use it in GitHub Desktop.
List AWS spot instance prices and sort by price
#!/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