Hacker News new | ask | show | jobs
by eecks 1981 days ago
Google, like AWS and Azure, is 'only pay for what you use'. Can anyone tell me if there is a way to put limits in? Or to choose a 20/50/100 dollar per month plan?
3 comments

In GCP you can configure budgets for projects (groups of resources). Budgets can issue alerts when reaching certain percentages and reconfigure or shutdown resources when exceeded.

The budget howto docs have an example to stop everything that incurs a cost on budget overrun: https://cloud.google.com/billing/docs/how-to/budgets

But as the warning says, that might delete data in storage or other resources you may want to keep paying for. For that case, you can execute a program, that shuts down everything you can get rid of, but the cost for storage and everything you forgot will continue to be billed.

Not quite. Please note that there are various things you pay for, let's take a look at several of those:

- provisioned resources (instances, including the ones under relational databases or other stuff like that)

- usage of on-demand resources like AWS Lambda and API Gateway

- infrastructure such as load balancers (kind of mix of provisioned and pay-per-use)

- persistent storage (which is all over the place in terms of payment methods)

While you could shut down the first three to save some money, would you like to remove your data permanently?

So far all mechanisms that are available are mostly reactive (billing alarms etc) rather than proactive (service quotas although they are meant to shield from poor design rather than a typo in terraform). There is clearly incentive for cloud providers for the former, but it's not an easy problem anyway (they might mark your accounts for "training" or something like that - I think this would be reasonable).

I've seen many companies user "terminator" scripts that shutdown/delete things that aren't tagged as "keep" or something like that, though only in non-production accounts. The budget alerts from the cloud providers can be useful too (AWS recently released cost anomaly alerts).

We're trying to tackle this problem with https://github.com/infracost/infracost from another angle for people who use Terraform: show a cost estimate in pull requests so the user understands what costs money, and roughly how much it costs. I hope that helps clarify "only pay for what you use" without trawling through cloud pricing pages.