Search code examples
google-cloud-platformcost-management

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.


Solution

  • 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.