问题
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?
回答1:
In your GCP Web Console,
- go to Billing page
- go to Billing export section
- you could either export the detail billing to BigQuery or File
- you could search the billing item in the export
- https://cloud.google.com/billing/docs/how-to/bq-examples
- https://cloud.google.com/billing/docs/how-to/export-data-file
And suggest you to use Label to label the resource, e.g. Compute Engine, for better resource management.
来源:https://stackoverflow.com/questions/51380014/how-can-i-get-the-billing-for-a-vm-instance-in-gcp