gcp-accountant
gcp-accountant copied to clipboard
A tool to identify high cost resources in GCP at a granular level
gcp-accountant
/:""|
|:`66|_
C` _)
\ ._|
) /
/`\\
|| |Y|
|| |#|
|| |#|
|| |#|
:| |=:
||_|,|
\)))||
|~~~`-`~~~|
| |
|_________|
|_________|
| ||
|_||__
jgs (____))
A tool to identify high-cost resources in GCP at a granular level
Prerequisites
-
You must have Billing export for BigQuery enabled
-
You must be authorized to create BigQuery jobs
-
It is highly recommended that resources be labeled at a granular level. The granularity of the labels will be reflected in the results.
Installation
npm install -g
Usage
Execute gcp-accountant and answer the questions:
$ gcp-accountant
? What is the billing dataset called? (Use arrow keys)
❯ billing
not-billing
not-billing-either
[..]
How it works
First, gcp-accountant makes use of inquirer and the Google BigQuery Client Library for Node.js to gather some info from the user:
- The name of the billing dataset
- The name of the billing table
- The invoice month to perform cost analysis on in
YYYYMMformat
Then gcp-accountant runs queries on the data by means of the aforementioned BigQuery client and the results are then displayed in the terminal by means of cliui and chalk.