In this tutorial, you are going to set up Google Cloud Platform Pricing and Cost Calculator on Google Cloud Shell.
Click the Start button to move to the next step.
Download the executable gcosts
Linux CLI program and save it to your home folder:
curl -L "https://github.com/Cyclenerd/google-cloud-pricing-cost-calculator/releases/latest/download/gcosts-linux-x86_64" \
-o ~/gcosts
Make it executable:
chmod +x ~/gcosts
Test:
~/gcosts help
Download the latest and tested price information file pricing.yml
and save it to your home folder:
curl -L "https://github.com/Cyclenerd/google-cloud-pricing-cost-calculator/raw/master/pricing.yml" \
-o ~/pricing.yml
Add gcosts
to your Bash aliases with absolute pathnames:
echo "alias gcosts='$HOME/gcosts --pricing $HOME/pricing.yml'" >> ~/.bash_aliases
Reload aliases:
source ~/.bash_aliases
You can then execute gcosts
:
gcosts --version
Create your first YAML usage file. To make it easier for you, you can use the prepared example.
Change to the directory usage
:
cd usage
Edit the file example.yml
:
edit example.yml
Edit example.yml
Run gcosts
in the current folder.
All YAML usage files (*.yml
) of the current directory are imported and the costs of the resources are calculated:
gcosts calc
The calculated costs are exported to one CSV (comma-separated values) file.
Without specifying the file location, the file is named costs.csv
and is saved in the current directory.
Download the CSV files:
dl costs.csv
You can import the CSV file with MS Excel, Apple Numbers, LibreOffice or Google Sheets.
Continue to familiarize yourself with the options. The following documentations are prepared for this purpose: