Hacker News new | ask | show | jobs
by MrDarcy 847 days ago
Google does provide a way, project owners can set a custom quota to limit costs.
1 comments

So your comment made me go look it up, and if you squint hard that's kind of true...

https://cloud.google.com/billing/docs/how-to/notify#cap_disa...

Notice that their "solution" is to tell you how if you want you can spin up effectively your own custom service to watch spend and if it goes over some threshold delete the entire project[0] after some delay. This is the malicious compliance version of letting you add a limit.

[0] At least, that's how I interpret "This example removes Cloud Billing from your project, shutting down all resources. Resources might not shut down gracefully, and might be irretrievably deleted. There is no graceful recovery if you disable Cloud Billing. You can re-enable Cloud Billing, but there is no guarantee of service recovery and manual configuration is required."

I meant this, linked directly off the big query cost estimation docs:

https://cloud.google.com/bigquery/docs/custom-quotas

> Custom quota is proactive, so you can't run an 11 TB query if you have a 10 TB quota. Creating a custom quota on query data lets you control costs at the project level or at the user level.

Oh, good catch! Yes, that does look like something that can be coerced into limiting it. Having actually tried to click through, it is very much not as simple as "don't spend more than $X"; the doc points to https://console.cloud.google.com/iam-admin/quotas and you have to find and set the right quota, but yes that can probably help.
Isn't it the quota limit that you need to set? https://cloud.google.com/bigquery/quotas#query_jobs