Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I set a hard limit to Google Cloud Platform spend? if yes, how?

I'd like to make sure I don't spend too much money in GCP (Google Cloud Platform) usage, but I'm not sure of the way to do so, if such a way exist.

So I tried creating budgets in GCP, but I doubt these are hard cap, since the documentation and this question (though asking about google developer console, therefore my question isn't, I think, a duplicate) seem to suggest Google budgets are simply sending notification, but don't put hard cap on your GCP usage.

Thank you for your help.

like image 783
Jonathan Simonney Avatar asked Aug 17 '18 06:08

Jonathan Simonney


2 Answers

It is possible to cap costs and stop usage for a Google Cloud project. You need to

  • setup up a budget to monitor project costs,
  • enable budget notifications
  • and then configure a Cloud Function to call the Cloud Billing API that disables billing for the project as described in GCP documentation.
like image 174
Jan M. Avatar answered Sep 22 '22 14:09

Jan M.


There isnt ~currently~ a way to centrally cap spending on most of the functionality in GCP - its been mentioned a few times on https://googlecloudplatform.uservoice.com/ and they do seem to be putting some work in on this side of things.

You can get alerted via this though https://cloud.google.com/billing/docs/how-to/budgets

like image 33
Dan Avatar answered Sep 20 '22 14:09

Dan