A fintech company requires automated workload management to prevent cost overruns on their primary Google Cloud billing account. A cloud architect must ensure that when accrued spending reaches 100% of a defined monthly threshold, an existing Cloud Run microservice is invoked to disable non-critical development workloads, while standard email alerts continue reaching the operations team. Which configuration approach should the architect implement?
- Configure a Cloud Billing budget with the 100% threshold rule, link a Cloud Pub/Sub topic to the budget notifications, and configure a Push subscription on the topic targeting the Cloud Run microservice endpoint.Cevap
- BConfigure a Cloud Billing budget with the 100% threshold rule and enable the automatic resource capping feature in the billing console to halt active Compute Engine instances when the limit is breached.
- CAssign the Billing Account User role to the Cloud Run service account at the individual project level, and configure the budget threshold rule to call the Cloud Run service URL directly via webhooks.
- DEnable the Cloud Billing API in the workload project, grant Project Owner permissions to the operations team, and rely on standard Cloud Billing email alert webhooks to invoke the Cloud Run endpoint.
Cevap
Configure a Cloud Billing budget with the 100% threshold rule, link a Cloud Pub/Sub topic to the budget notifications, and configure a Push subscription on the topic targeting the Cloud Run microservice endpoint.
Google Cloud Billing budgets send notifications when spend threshold rules are met. Standard alerts send emails, but automated actions require attaching a Cloud Pub/Sub topic to the budget. Pub/Sub receives JSON payloads describing current costs and budget limits, which can then trigger a subscriber such as Cloud Run to programmatically stop instances or disable billing.
Adım Adım Çözüm
Anahtar Kavram
Programmatic Billing Budget Notifications via Pub/Sub