The terraform-cost-estimation project will surface a before/after cost estimation for GCP infrastructure deployed by Terraform.
This is not an officially supported Google product.
Display before/after cost estimation of resources from Terraform plan files in JSON format.
Resources supported:
- google_compute_instance
Currently in production:
- google_compute_disk
In the command line, run:
$ go run main.go [OPTIONS] FILES
-
format
- Write the pricing information in the specified format.
- Can be set to: txt, json, html.
- If omitted, it defaults to 'txt'.
-
output
- Write the cost estimations to the given paths.
- If set to 'stdout', all the outputs will be shown in the command line.
- Multiple output file names must be delimited by ','.
- Mixed file names and stdout values are allowed.
$ go run main.go input.json
$ go run main.go -output=json input.json
$ go run main.go -format=html -output=out1.html,out2.html input1.json input2.json
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β The total cost change for all Resources is 0.047500 USD/hour. β
βββββββββββββββββββββββ¬ββββββββββββββββββββββ¬ββββββββββββββββββββββ¬ββββββββββββββββββββββ¬ββββββββββββββββββββββ€
β Pricing Information β
β (USD/h) β
βββββββββββββββββββββββ¬ββββββββββββββββββββββ¬ββββββββββββββββββββββ¬ββββββββββββββββββββββ¬ββββββββββββββββββββββ€
β Name β ID β Type β Action β Delta β
βββββββββββββββββββββββΌββββββββββββββββββββββΌββββββββββββββββββββββΌββββββββββββββββββββββΌββββββββββββββββββββββ€
β test1 β 730331501208101640 β n1-standard-2 β update β 0.047500 β
βββββββββββββββββββββββ΄ββββββββββββββββββββββ΄ββββββββββββββββββββββ΄ββββββββββββββββββββββ΄ββββββββββββββββββββββ
List of all Resources:
βββββββββββββββββββββββ¬ββββββββββββββββββββββ¬ββββββββββββββββββββββ¬ββββββββββββββββββββββ¬ββββββββββββββββββββββ
β Name β test1 β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β ID β 730331501208101640 β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Zone β us-central1-b β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Machine type β n1-standard-1 -> β
β β -> n1-standard-2 β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Action β update β
βββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Pricing Information β
β (USD/h) β
βββββββββββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββ¬ββββββββββββββββββββββ¬ββββββββββββββββββββββ€
β β CPU β RAM β Total β
βββββββββββββββββββββββ¬ββββββββββββββββββββββΌββββββββββββββββββββββΌββββββββββββββββββββββΌββββββββββββββββββββββ€
β Before β Cost β 0.031611 β 0.004237 β 0.047500 β
β β per β β β β
β β unit β β β β
β βββββββββββββββββββββββΌββββββββββββββββββββββΌββββββββββββββββββββββΌ β
β β Number β 1 β 3.75 β β
β β of β β β β
β β units β β β β
β βββββββββββββββββββββββΌββββββββββββββββββββββΌββββββββββββββββββββββΌ β
β β Units β 0.031611 β 0.015889 β β
β β cost β β β β
βββββββββββββββββββββββΌββββββββββββββββββββββΌββββββββββββββββββββββΌββββββββββββββββββββββΌββββββββββββββββββββββ€
β After β Cost β 0.031611 β 0.004237 β 0.095000 β
β β per β β β β
β β unit β β β β
β βββββββββββββββββββββββΌββββββββββββββββββββββΌββββββββββββββββββββββΌ β
β β Number β 2 β 7.50 β β
β β of β β β β
β β units β β β β
β βββββββββββββββββββββββΌββββββββββββββββββββββΌββββββββββββββββββββββΌ β
β β Units β 0.063222 β 0.031778 β β
β β cost β β β β
βββββββββββββββββββββββΌββββββββββββββββββββββΌββββββββββββββββββββββΌββββββββββββββββββββββΌββββββββββββββββββββββ€
β DELTA β UP (β) β 0.031611 β 0.01588875 β 0.04749975 β
βββββββββββββββββββββββ΄ββββββββββββββββββββββ΄ββββββββββββββββββββββ΄ββββββββββββββββββββββ΄ββββββββββββββββββββββ