Cost Management

Money matters: Automating your Cloud Billing budgets

#finserv

The bigger a cloud environment, the more important it is to have robust cost management tools, including budget automation capabilities. Budgeting tools can help you avoid unnecessary costs via proactive notifications of future (and actual) overages. Billing automation can help you support multiple budgets, each with very granular filters (we have customers with thousands of individual budgets!), and customize your budget notifications. Here on the Cloud Billing team, we’ve been working hard to improve these capabilities based on your feedback, and are excited to announce several enhancements: 

  • General availability (GA) of the Budgets API (learn more)

  • Granular choice of credits - choose specific credits to include in your budget (learn more)

  • Customized budget alert email recipients - send email notifications to whoever you want, as well as remove billing admins and users from the default list (learn more)

Let’s take a look at these new features in greater depth. 

Cloud Billing’s latest budgeting features

Our goal with Cloud Billing is to create an enterprise-grade cost management suite, complete with all the tools you need to manage the largest and most complex of cloud environments. Read on to learn more about Cloud Billing’s new budgeting and automation capabilities. 

Budgets API

Earlier this month we announced the general availability of the Budgets API. The Budgets API allows you to do almost everything from within the Cloud Billing UI: create, edit and delete budgets, as well as use its scoping and filtering capabilities. You can interact with the API directly through REST calls, or with our Java, Node.JS, Python, GO, and .NET client libraries. 

Where the UI and API capabilities differ, know that those differences will be short-lived—our goal is to ultimately deliver feature parity between the UI and the API. 

The Budgets API is especially useful when you want to automate budget creation, i.e., create a budget when a team spins up a new project. It’s also great for editing budgets en masse. For example, if you know you’re about to have a spike in sales, you could increase all related budgets by 20%. 

Another great use for the Budgets API is to obfuscate and simplify your end users’ permission model for budget creation and editing. If your company already has a self-managed portal for cloud resource management, you can integrate simple budget experiences there, and then use a Service Account to create or edit the budgets. This way, you don’t need to give your users budget-related IAM permissions to allow them to do more than they were originally set up to do. Learn more in our documentation.

Improved credits filtering.jpg

Previously, the credits setting was a simple checkbox that let you include available credits in your budget. Now, you can choose specific credit families, such as discounts or promotions, or even specific credit types (e.g., free tiers). For example, you can build a durable budget that excludes any one-time promotional credits that you may receive at the free tier level. 

Customized budget alert email recipients

Cloud Billing is now integrated with Cloud Monitoring so you can send notification emails to up to five notification channels; in addition you can decide whether or not to send budget notifications to billing users and admins. With these two features together, you can ensure that notifications are sent to the appropriate recipients.

Programmatic budget notifications

Just like the ability to automate budget creation, Cloud Billing can also alert Pub/Sub topics about changes to a budget. Unlike with email notifications, Cloud Billing notifies the Pub/Sub topics regardless of whether a budget threshold has been crossed, and that information can be easily incorporated into your business logic. You can see some examples of programmatic budget notifications here, including posting to a Slack channel.

A sample process

How might you use these features together? Here’s a sample process that you could implement in your organization to create a budget for a project, monitor it, and automatically disable the project if it reaches a certain threshold.

  1. Initiate infrastructure deployment using your tool of choice, for example Terraform or another Infrastructure as Code tool.

  2. That in turn calls into Google Cloud Build to deploy your custom workflows across multiple environments, including VMs, serverless, Kubernetes, or Firebase.

  3. Using the Google Cloud Budget API, create an overall budget for the new project, using actual amounts, as well as forecasted thresholds.You can send notifications to: 

    1. Billing admins and specific employees via Cloud Monitoring channels

    2. A Pub/Sub topic

  4. Create a cloud function to monitor the Pub/Sub topic, which automatically disables billing if spend is over 150% of budget. This happens if (and only if), this is a test environment, as determined by the environment label. For all other environments publish a message to the team Slack channel.

sample process.jpg
Click to enlarge

See code examples here

Your budget, your way

Every organization is different, and you need the ability to customize the rate at which you consume your cloud resources. We continue to add features to Cloud Billing that allow any organization—from the smallest business to the largest enterprise—to manage their budget how they want, with programmatic methods that enable granular budgets and automated cost controls. To learn more and get started with budgeting on Cloud Billing, check out the documentation.