Want to keep tabs on your Google Cloud spend for storage, compute and egress 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 workspaces (after September 27, 2021) or Terra Billing projects (before September 27, 2021).
What Google Cloud budget alerts can (and cannot) do
If you are the Google Cloud Billing account owner or administrator, you can create a Google Cloud budget to monitor your storage, compute and egress charges on Terra.
Use budget alerts to
- Set budgets for the umbrella Google Cloud Billing account or for specific workspaces (after September 27, 2021) or your Terra Billing project (before September 27, 2021).
- Set budget alerts to match grant timing
Cloud Billing Budgets alerts support configurable budget time periods, beyond monthly budgets. Is your budget tied to an external funding source, such as a grant? Now you can set the budget for the time range of the grant.
- Automate cost control responses
- Cap billing by disabling Google Cloud Billing accounts
- Set up email alerts for notification when thresholds are reached
- Send to Google Cloud Billing account owner
- Send to up to five additional custom email addresses
What budget alerts cannot do
- Identify individual user spend in a shared workspace
This is because budget alerts are at the Google project level (i.e., per workspace - for workspaces created after September 27, 2021 - or per Terra Billing project - for workspaces created before September 27, 2021 - and per ).
- Give immediate spend reporting
There is a delay between when you use a resource and when it's reported by Google. The delay is at least 24 hours but can be up to a few days between when you incur costs and when you receive budget notifications. Due to this latency, you might incur additional costs for usage that hasn't arrived at the time that all services are stopped.
Following this capping example is not a guarantee that you will not spend more than your budget. This is due to the the lag in spend reporting.
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 Google Cloud alerts?
To set budget alerts on a Google Cloud Billing account
You must be an Owner or Admin on the Google Cloud account.
To set budget alerts on a Terra workspace
- The workspace must be created after September 28, 2021.
- You must have owner or admin privileges on the workspace.
- You must have viewer permissions on the Google Cloud Billing account.
Troubleshooting tipsIf any of the actions in the step-by-step instructions are not allowed (grayed out), you probably do not have sufficient permissions. You need to ask the Cloud Billing account owner to update your role.
Budget alerts cannot be set if you are using free credits
Note: Google Cloud is the Owner of Google Cloud free credits projects. You can't set budget alerts for these until you upgrade to a paid Google Cloud Billing account.
To change/add Google Cloud Billing account permissions
The Owner or Administrator of the Billing account should go to https://console.cloud.google.com/billing to manage the account.
- Choose the Billing account to add a member.
- Select the "Manage" link at the top right.
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 Google's documentation.
Set up a budget alert for a Terra workspace in three steps
Step 1. Set budget scope
1.1. Go to the main navigation menu at the top left on the Google Cloud console (console.cloud.google.com).
1.2. Select Billing and then the Google Cloud Billing account link (name).
1.3. Choose Budgets and alerts in the left column.
1.4. Click Create budget and, in the form that appears, give your budget a sensible Name.
1.5. Select the project for the budget from the dropdown.
Finding the right Google project
Workspace projects (created by Terra) will have the format
To find a specific workspace Google project, open your workspace dashboard page in a separate tab, look under "Workspace Information" on the right column.
1.6. Select the service you want alerts for (i.e., storage, compute).
You can filter the list by typing in the name of the service you want to track. Services Terra uses include Compute Engine (i.e., virtual machine (VM) and Cloud Storage (i.e., Workspace buckets)
1.7. Click Next to continue.
Step 2. Set the amount
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.
Step 3. Set alert actions
3.1. Set the threshold rules (you can set alerts as a fraction of the total budget or a specific amount, and trigger by actual or forecasted spend).
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)
More Google Cloud documentation about budget alerts
For more details on Google Cloud budget alerts, see https://cloud.google.com/billing/docs/how-to/budgets#permissions_required_to_manage_budgets.
To learn 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.