Cloud Billing
Cloud Billing pays for Google Cloud projects through a billing account and can alert when spending approaches a budget. The GCP Enterprise Baseline links all 14 projects to one billing account and lets any project carry a monthly budget alert.
What it does
A billing account pays for every project linked to it; a project without one cannot use paid services. The account has its own IAM: Billing Account User may link projects to it, Billing Account Administrator manages it. Each billing account has a quota of projects it may pay for. A budget watches the spend of a billing account or of selected projects against an amount and sends alerts at threshold rules, by default to the billing account's administrators and users by email. A budget only alerts; it never stops a service.
How BuiltForProd uses it
One billing account. billing_account_id in common.hcl names the account, set once for the whole organization. The organizations unit links every project to it as it creates them, which is why the account's project quota must allow 14 projects before the stage and core projects are created. The Baseline repository's CI account sa-acme-baseline-ci holds Billing Account User on the account, enough to link projects and no more; it cannot change the account itself.
Budget alerts per project. The project-baseline unit creates a budget when the project's budget_amount is above zero:
| Setting | Value |
|---|---|
| Name | <project id> monthly, for example acme-plat-prod monthly |
| Scope | That project only |
| Amount | budget_amount in USD per month; 0, the default, means no budget |
| Thresholds | 80% and 100% of the amount |
A core project sets the amount with a budget_amount local in its stack file before the shared include; a stage project passes budget_amount as a value to the plat-project template. No notification channel is attached, so the alerts go to the billing account's administrators and users.
What the Baseline costs. Every switch that adds cost carries its list price in a comment in its switch file, so a decision is one reviewed line: for example Cloud NAT (about $32 per month each plus $0.045 per GB), Data Access logs ($0.50 per GiB after the free allotment), Artifact Analysis (about $0.26 per image) or Cloud Armor Enterprise ($3,000 per month per organization). Labels on every resource (namespace, environment, stage, managed_by, repository) let billing reports split the spend.
The project baseline enables cloudbilling.googleapis.com and billingbudgets.googleapis.com in every project, so budgets need no manual API step.
Terms you will see
| Term | Meaning |
|---|---|
| Billing account | The account that pays for the linked projects. |
| Billing Account User | The role that may link a project to the account. |
| Project quota | How many projects a billing account may pay for. |
| Budget | A monthly amount and thresholds that trigger alerts. |
| Threshold rule | A percentage of the budget at which an alert is sent: 80% and 100%. |
Where to read more
- GCP Enterprise Baseline overview for the cost switches.
- Resource Manager for the projects the account pays for.
- Billing FAQ for questions about BuiltForProd billing.