Last active
          July 6, 2021 13:05 
        
      - 
      
 - 
        
Save matschaffer/4912279e49dce41ab9b2 to your computer and use it in GitHub Desktop.  
Revisions
- 
        
matschaffer revised this gist
Jun 11, 2015 . 1 changed file with 20 additions and 5 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,23 @@ #!/usr/bin/env bash URL="http://a0.awsstatic.com/pricing/1/ec2/ri-v2/linux-unix-shared.min.js" (echo 'function callback(data) { console.log(JSON.stringify(data)); }'; curl -s "$URL") |\ node |\ jq -r '.config.regions[] | select(.region == "us-east-1") | .instanceTypes[] | [ .type, ( .terms[] | select(.term == "yrTerm1") | .onDemandHourly[].prices.USD ), ( .terms[] | select(.term == "yrTerm1") | .purchaseOptions | map(.valueColumns[] | select(.name == "effectiveHourly") | .prices.USD)[] ), ( .terms[] | select(.term == "yrTerm3") | .purchaseOptions | map(.valueColumns[] | select(.name == "effectiveHourly") | .prices.USD)[] ) ] | join("\t") '  - 
        
matschaffer created this gist
Jun 11, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ (echo 'function callback(data) { console.log(JSON.stringify(data)); }'; curl -s 'http://a0.awsstatic.com/pricing/1/ec2/linux-od.min.js') |\ node |\ jq -r '.config.regions[] | select(.region == "us-east-1") | .instanceTypes | map(.sizes)[][] | [.size, .valueColumns[].prices.USD] | join("\t")'