How to download all the AWS pricing in bash

Hello, this bash one-liner needs bash, a correctly configured AWS CLI, wget, jq and that’s it.

The script will:

  1. Download the master file
  2. Parse the json file with jq extracting, for each product, the url of the current version
  3. Create a folder hierarchy with the name of the product (done by the settings of wget)
  4. Save the pricing, in that directory

For example the pricing of AmazonQLDB will be in the folder AmazonQLDB/current/


wget -q -O -  | jq -r '.offers[].currentVersionUrl'  | wget -x  --base="" --no-host-directories --cut-dirs=3 -i -


wget -q -O -  | jq -r '.offers[].currentVersionUrl' | sed 's/\.json$/.csv/' | wget -x  --base="" --no-host-directories --cut-dirs=3 -i -
comments powered by Disqus