Question

Difficulty: HardCreating Billing Budgets, Alerts, and BigQuery Exports

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?

  1. 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.Answer
  2. B
    Configure 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.
  3. C
    Assign 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.
  4. D
    Enable 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.

Answer

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.

Step-by-Step Solution

1
Analyze budget notification capabilities
Recognize that Cloud Billing budgets send alerts to billing admins via email by default, but require programmatic integration for automated actions.
Budgets do not shut down resources or execute webhooks natively.
2
Determine the programmatic notification path
Connect a Cloud Pub/Sub topic to the Cloud Billing budget threshold rule.
Cloud Billing publishes JSON event payloads to Pub/Sub whenever threshold percentages are crossed.
3
Configure the automation consumer
Create a Cloud Pub/Sub Push subscription configured with the Cloud Run service endpoint as its target.
This allows the Pub/Sub service to deliver the notification payload directly to Cloud Run to execute custom resource disabling logic.

Key Concept

Programmatic Billing Budget Notifications via Pub/Sub
Rate this question