A Cloud Billing account pays for one or more projects. A project without an active billing account cannot use paid services.
flowchart LR BA["Cloud Billing account"] --> P1["Project dl-shop-prod"] BA --> P2["Project dl-shop-dev"] BA --> B["Budget 500 USD / month"] B --> N["Alert email and Pub/Sub at 50 / 90 / 100%"] BA --> X["Billing export to BigQuery"] X --> D["Cost report by label env, team"] %% step BA: A Cloud Billing account holds the payment method and is linked to projects. %% step P1: Each project is linked to exactly one billing account at a time. %% step B: A budget watches actual or forecast spend for the account, projects or labels. %% step N: Thresholds send emails and optional Pub/Sub messages; a budget never stops resources by itself. %% step X: The export streams detailed usage and cost rows into a BigQuery dataset. %% step D: Labels such as env and team let you group the exported costs in reports.
Billing roles
| Role | Can |
|---|---|
| Billing Account Administrator | Manage the account, payment, link/unlink projects |
| Billing Account User | Link projects to this account (with Project Billing Manager or Owner on the project) |
| Billing Account Viewer | Read costs and invoices |
| Project Billing Manager | Link/unlink one project, without seeing the account’s money |
To link a project you need rights on both sides: the billing account and the project.
Budgets and alerts
- A budget can cover the whole billing account or filter by project, service or label.
- Thresholds use actual or forecasted spend (for example 50%, 90%, 100%).
- Budgets only alert. To stop spending automatically, publish budget notifications to Pub/Sub and have a Cloud Run function disable billing or scale resources down.
Labels vs tags
| Labels | Tags | |
|---|---|---|
| Format | key=value on a resource |
Tag key/value resources defined at org/project level |
| Purpose | Cost breakdown, filtering, automation | Conditional IAM and firewall policies |
| Inherited? | No | Yes, down the hierarchy |
Use a small, enforced label set, for example env, team, app, cost-center. Labels appear in the billing export, so SELECT labels ... SUM(cost) gives cost per team.
Saving money
- Sustained use discounts apply automatically to some VM families that run most of the month.
- Committed use discounts (1 or 3 years) trade a commitment for a lower price.
- Spot VMs are up to 60–91% cheaper but can be stopped at any time.
- Use the Pricing Calculator before you build, and Recommender to find idle VMs and oversized machines.
| Command | Meaning |
|---|---|
gcloud billing accounts list |
Billing accounts you can see |
gcloud billing projects link dl-lab-dev --billing-account=01A2B3-C4D5E6-F7A8B9 |
Link a project |
gcloud billing budgets create --billing-account=… --display-name=… --budget-amount=500USD |
Create a budget |
Traps: a budget does not cap costs; labels are not inherited by child resources; unlinking billing stops paid resources and can lead to data deletion.