Want to keep tabs on your GCP spend for storage and compute in Terra? This article outlines what budget alerts can (and cannot) do, what permissions are needed for these actions, and step-by-step instructions for setting up budget alerts for Terra Billing projects.
What GCP budget alerts can (and cannot) do
If you are the GCP Billing account owner or administrator, you can create a GCP budget to monitor your GCP charges on Terra (i.e. storage, compute and egress):
- Set budgets for the umbrella GCP Billing account or for specific projects like your Terra Billing project
- Set up email alerts for notification when thresholds are reached
- Sent to GCP Billing account owner
- Sent to up to five additional custom email addresses
- Use budgets to automate cost control responses
- Cap billing by disabling GCP Billing accounts
|There is a delay of up to a few days between incurring costs and receiving budget notifications. Due to usage latency from the time that a resource is used to the time that the activity is billed, you might incur additional costs for usage that hasn't arrived at the time that all services are stopped.
Following the steps in this capping example is not a guarantee that you will not spend more than your budget.
Recommendation: If you have a hard funds limit, set your maximum budget below your available funds to account for billing delays.
What permissions do you need to set up GCP alerts
To set budget alerts on a GCP account
1. You must have owner or admin privileges on the GCP account
To set budget alerts on a Terra billing project
1. You must have owner or admin privileges on the Terra billing project
2. You must have "Viewer" permissions on the GCP Billing account
|If any of the actions in the step-by-step instructions are not allowed (grayed out), you probably do not have sufficient permissions.
Fee credits example
To change/add GCP Billing account permissions
There are additional fine-grained permissions you can set up to allow specific programmatic actions. To learn more about permissions requirements for programmatic budget alert actions (e.g. disabling billing), see https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#permissions_required_for_this_task.
How to set up a GCP budget alert for a Terra project
1. Set budget scope (expand for step-by-step instructions)
1.1. Go to the top left navigation menu on the GCP console (console.cloud.google.com)
1.2. Select "Billing"
1.3. Choose "Budgets and alerts"
1.4. Name your budget
1.5. Select the project for the budget
1.6. Select what service you want alerts for (i.e. storage, compute)
1.7. Click "Next" to continue
2. Set the amount (expand for instructions)
2.1. Choose the budget type from the dropdown
Can be last month's spend, or a specified amount
2.2. Set the target amount (if you're using a specified amount)
2.3. Click "Next" to continue
3. Set alert actions (expand for instructions)
3.1. Set the threshold rules (you can set alerts as a fraction of the total budget or a specific amount)
3.2. Send alert to billing admins and users (selected by default)
3.3. Send alert to up to five additional emails
3.4. Set up additional actions (e.g. disabling billing) by connecting a Pub/Sub topic to the budget (for more detailed information about this functionality, see https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications)
|For more details on GCP budget alerts, see https://cloud.google.com/billing/docs/how-to/budgets#permissions_required_to_manage_budgets
To learn more about additional actions you can program alerts to execute (such as disabling billing), see https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications