This document explains how to send budget notifications to Slack.
Budgets
are typically configured to send email notifications. However, email isn't
always the best way to stay up to date on your cloud costs, particularly if
your budget is critical and time sensitive. With programmatic notifications,
you can forward your budget messages to other mediums, such as
Slack.
Before you begin
Before you begin, you must complete the following tasks:
The first step is to create your Slack workspace and the bot user tokens
that are used to call the Slack API. API tokens can be managed at
https://api.slack.com/apps.
For detailed instructions, see
Bot Users
on the Slack site.
Set up a Cloud Run function
Complete the steps in
Create a Cloud Run function.
Ensure that the Trigger type is set to the same Pub/Sub
topic that your budget will use.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-21 UTC."],[[["This guide outlines how to configure budget notifications to be sent to a Slack channel instead of just email."],["Before setting up Slack notifications, you must enable the Cloud Billing API, create a budget, and set up programmatic budget notifications."],["Setting up Slack requires creating a workspace and managing bot user tokens through the Slack API interface."],["A Cloud Run function is created to receive Pub/Sub messages and then use the Slack API to post notifications to a designated Slack channel, with example code provided in Node.js and Python."],["After configuring, you can test the function to ensure messages are successfully delivered to Slack, with further options provided to control resource usage and billing through notifications."]]],[]]