Skip to content

Latest commit

History

History
100 lines (70 loc) 路 2.54 KB

cloud-shell-tutorial.md

File metadata and controls

100 lines (70 loc) 路 2.54 KB

How to set up GCP Cost Calculator

Welcome 馃憢!

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.

Get gcosts program

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 price information

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 alias

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

First usage file

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 it

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

Download

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.

Done 馃帀

Continue to familiarize yourself with the options. The following documentations are prepared for this purpose: