Skip to content

Instantly share code, notes, and snippets.

@grrywlsn
Last active September 25, 2017 13:40
Show Gist options
  • Save grrywlsn/ba7b4e4471ae18bfe8a6ece1854f6622 to your computer and use it in GitHub Desktop.
Save grrywlsn/ba7b4e4471ae18bfe8a6ece1854f6622 to your computer and use it in GitHub Desktop.
jq to grab AWS instance hourly cost
curl --silent "http://www.ec2instances.info/instances.json" | jq '.[] | select(.instance_type=="r4.large").pricing["eu-west-1"].linux.ondemand'
@grrywlsn
Copy link
Author

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