Last active
September 25, 2017 13:40
-
-
Save grrywlsn/ba7b4e4471ae18bfe8a6ece1854f6622 to your computer and use it in GitHub Desktop.
jq to grab AWS instance hourly cost
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
curl --silent "http://www.ec2instances.info/instances.json" | jq '.[] | select(.instance_type=="r4.large").pricing["eu-west-1"].linux.ondemand' |
Optionally curl --silent "http://www.ec2instances.info/instances.json" | jq '.[] | select(.instance_type=="r4.large").pricing["eu-west-1"].linux.ondemand' | sed 's/"//g'
will remove the doublequotes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This will fetch the current AWS instance price for a given instance type in a given region. It uses ec2instances.info which is generally an accurate and reliable source.