Google Cloud Platform
Better cost control with Google Cloud Billing programmatic notifications
By running your workloads on Google Cloud Platform (GCP) you have access to the tools you need to build and scale your business. At the same time, it’s important to keep your costs under control by informing users and managing their spending.
Today, we’re adding programmatic budget notifications to Google Cloud Billing, a powerful feature that helps you stick to your budget and take automatic action when your budget is out of control.
Monitor your costs
You can use Cloud Billing budget notifications with third-party or homegrown cost-management solutions, as well as Google Cloud services. For example, as an engineering manager, you can set up budget notifications to alert your entire team through Slack every time you hit 80 percent of your budget.
Control your costs
You can also configure automated actions based on the notifications to control your costs, such as selectively turning off particular resources or terminating all resources for a project. For example, as a PhD student working at a lab with a fixed grant amount, you can use budget notifications to trigger a cap to terminate your project when you use up your grant. This way, you can be confident that you won’t go over budget.
Work with your existing workflow and tools
To make it easy to get started with budget notifications, we’ve included examples of reference architectures for a few common use cases in our documentation:
- Monitoring - listen to your PubSub notifications with Cloud Functions
- Forward notifications to Slack - send custom billing alerts with the current spending for your budget to a Slack channel
- Cap (disable) billing on a project - disable billing for a project and terminate all resources to make sure you don’t overspend
- Selectively control resources - when you want to terminate expensive resources but not disable your whole environment.
You can set up programmatic budget notifications in a few simple steps:
- Navigate to Billing in the Google Cloud Console and create your budget.
- Enable Cloud Pub/Sub, then set up a Cloud Pub/Sub topic for your budget.
- When creating your budget you will see a new section “Manage notifications” where you can configure your Cloud Pub/Sub topic.
- Set up a Cloud Function to listen to budget notifications and trigger an action. Cloud Billing sends budget notifications multiple times per day, so you will always have the most up-to-date information on your spending.