This command line tool will analyze the invoice from a cloud provider and create a report with the total usage and cost, including the equivalent products and cost on GCP. We take the invoice CSV as input, and generate an ascii table or a CSV file with the information extracted.
This tool requires nodejs.
DISCLAIMER: This is not an officially supported Google product.
Only the AWS invoice is supported at this time. Invoice Insights can process the following services from the invoice:
Invoice Insights can translate to the following services on Google Cloud:
The following is a list of to-do features in the roadmap:
# Get high-level summary from an AWS invoice npx @google-cloud/invoice-insights summary invoice.csv # Get VM stats and GCP equivalent npx @google-cloud/invoice-insights instances invoice.csv --format csv # Print mappings with debug information, rounding to months, overriding a region mapping npx @google-cloud/invoice-insights instances invoice.csv --debug --roundMonths --mapRegion eu-central-1=europe-west1
We search for a VM with the same number of CPUs and a difference in memory below the predefined memory window (10% by default). If there is no match, a custom VM will be used instead.
Shared core (
t2 instances on AWS) will be mapped to
g1-small on GCP when possible, or to a standard VM otherwise. Instance mappings can be overriden with
--mapInstance, and region mapping with
--mapRegion. These arguments can receive multiple values.
npx @google-cloud/invoice-insights invoice.csv --mapInstance t2.nano=n1-standard1 --mapInstance t2.micro=n1-standard2 --mapRegion eu-central-1=europe-west1
When calculating SUDs, we assume that VMs are running 730 hours per month (100% of the time) where possible. This is used to estimate the number of concurrent instances.
If pricing details are considered sensitive information, filter out these columns when creating the invoice export from AWS:
Pull Requests are welcome! If you are planning to work on this code, this is what you need to get started.
# Download the latest SKUs and VM sizes bin/get-aws-skus bin/get-gcp-skus bin/get-gcp-vm-types # Test that the downloaded files are well-formed JSON npx jsonlint third_party/ec2instances.info/aws-skus.json npx jsonlint assets/gcp-skus.json npx jsonlint assets/gcp-vm-types.json # Run the tests: (add --watch to keep watching) npx mocha -r esm
To explore the SKUs manually:
# Find all SKUs for RAM and memory on Google Cloud grep 'Ram running in' assets/gcp-skus.json | sort | uniq -u grep 'Core running in' assets/gcp-skus.json | sort | uniq -u # Find all SKUs for commitment 1yr cat assets/gcp-skus.json | jq '. | select(.category.usageType=="Commit1Yr") | .description' | sort | uniq -u # Find all Cloud SQL SKUs cat assets/gcp-skus.json | jq '. | select(.category.serviceDisplayName=="Cloud SQL" and (.description | contains("Network") | not ) ) | .description' | sort | uniq -u # Find all SKUs with more than one pricing tier (for example f1-micro is free the first 730 hours) cat assets/gcp-skus.json | jq '. | select(.pricingInfo.pricingExpression.tieredRates | length > 1) | .description'|sort |uniq -u