You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| <aname="input_backplane_project_id"></a> [backplane\_project\_id](#input\_backplane\_project\_id)| The project hosting the building block backplane resources |`string`| n/a | yes |
34
+
| <aname="input_backplane_service_account_name"></a> [backplane\_service\_account\_name](#input\_backplane\_service\_account\_name)| The name of the service account to be created for the backplane |`string`|`"building-block-budget-alert"`| no |
35
+
| <aname="input_billing_account_id"></a> [billing\_account\_id](#input\_billing\_account\_id)| The billing account ID where budget permissions will be granted |`string`| n/a | yes |
36
+
37
+
## Outputs
38
+
39
+
| Name | Description |
40
+
|------|-------------|
41
+
| <aname="output_backplane_project_id"></a> [backplane\_project\_id](#output\_backplane\_project\_id)| The project hosting the building block backplane resources |
42
+
| <aname="output_billing_account_id"></a> [billing\_account\_id](#output\_billing\_account\_id)| The billing account ID where budget permissions were granted |
43
+
| <aname="output_credentials_json"></a> [credentials\_json](#output\_credentials\_json)| The JSON credentials for the backplane service account |
44
+
| <aname="output_service_account_email"></a> [service\_account\_email](#output\_service\_account\_email)| Email address of the backplane service account |
45
+
| <aname="output_service_account_id"></a> [service\_account\_id](#output\_service\_account\_id)| ID of the backplane service account |
This building block sets up a GCP budget alert on your account and is intended for teams managing GCP workloads who want to avoid accidental overspending by proactively monitoring cloud costs.
2
+
3
+
## 🚀 Usage Example
4
+
5
+
A development team sets up a GCP budget alert to **receive notifications** when their monthly GCP spend exceeds 80% of their allocated budget.
6
+
7
+
You can customize when alerts are triggered by providing a YAML string to the `alert_thresholds_yaml` input variable. Each entry specifies a percentage threshold and whether it applies to actual or forecasted spend.
8
+
9
+
**Example input:**
10
+
```yaml
11
+
- percent: 80
12
+
basis: ACTUAL
13
+
- percent: 100
14
+
basis: FORECASTED
15
+
```
16
+
17
+
- `percent`: The percentage of the budget that will trigger an alert (e.g., `80` for 80%).
18
+
- `basis`: Whether the alert is based on `ACTUAL` spend or `FORECASTED` spend.
19
+
20
+
This allows you to receive notifications both when your actual spend reaches a certain threshold and when your forecasted spend is projected to exceed your budget.
21
+
22
+
## 🔄 Shared Responsibility
23
+
24
+
| Responsibility | Platform Team ✅ | Application Team ✅/❌ |
## 💡 Best Practices for Choosing a Budget Threshold
32
+
To set an effective budget alert:
33
+
- Start with **historical GCP spend** as a baseline.
34
+
- Set alerts at **80% and 95% of the budget** to allow for proactive adjustments.
35
+
- Consider **seasonal or usage-based variations** in cloud costs.
36
+
- Use **multiple alerts** (e.g., per service, per team) if necessary to get granular insights.
37
+
38
+
---
39
+
Would you like to include specific details about notification methods (e.g., email, Slack, Pub/Sub, etc.) or tie this into your overall cloud governance policies? Let me know if you want refinements! 🚀
| <aname="input_alert_thresholds_yaml"></a> [alert\_thresholds\_yaml](#input\_alert\_thresholds\_yaml)| YAML string defining alert thresholds as a list of objects having fields 'percent' and 'basis' |`string`|`"- percent: 80\n basis: ACTUAL\n- percent: 100\n basis: FORECASTED\n"`| no |
39
+
| <aname="input_backplane_project_id"></a> [backplane\_project\_id](#input\_backplane\_project\_id)| The project ID where the backplane resources will be created |`string`| n/a | yes |
40
+
| <aname="input_billing_account_id"></a> [billing\_account\_id](#input\_billing\_account\_id)| The ID of the billing account to which the budget will be applied |`string`| n/a | yes |
41
+
| <aname="input_budget_currency"></a> [budget\_currency](#input\_budget\_currency)| The currency for the budget amount, e.g., EUR |`string`|`"EUR"`| no |
42
+
| <aname="input_budget_name"></a> [budget\_name](#input\_budget\_name)| Display name for the budget |`string`| n/a | yes |
0 commit comments