How can I get the billing for a VM Instance in GCP?

7/17/2018

I have a project in Google Cloud, where I have multiple instances running, and I have a billing account for the organisation. But I want to make a VM instance, say vm-01 for couple of hours then it will be deleted. I want to get the exact cost that vm-01 incurred during it's period using the API calls. Is it possible?

-- karn
api
google-cloud-platform
google-compute-engine
google-kubernetes-engine

1 Answer

7/18/2018

In your GCP Web Console,

  1. go to Billing page
  2. go to Billing export section
  3. you could either export the detail billing to BigQuery or File
  4. you could search the billing item in the export

And suggest you to use Label to label the resource, e.g. Compute Engine, for better resource management.

-- kkpoon
Source: StackOverflow