Question

Difficulty: MediumCreating Billing Budgets, Alerts, and BigQuery Exports

A cloud administrator needs to set up an automated cost-control mechanism that caps spending by triggering a Cloud Run service whenever a project's monthly expenditure exceeds $5,000. Which action should the administrator take when configuring the Cloud Billing budget to enable this automated workflow?

  1. Publish budget notifications to a Cloud Pub/Sub topic configured to trigger the Cloud Run service.Answer
  2. B
    Select the automatic instance shutdown action directly within the Cloud Billing budget threshold settings.
  3. C
    Grant the Cloud Billing Account Administrator role to the Cloud Run service account.
  4. D
    Enable the Cloud Billing API inside the Cloud Run project to allow budget alert execution.

Answer

Publish budget notifications to a Cloud Pub/Sub topic configured to trigger the Cloud Run service.
Publishing budget notifications to a Cloud Pub/Sub topic enables event-driven cost governance. When threshold events occur, Cloud Billing publishes a message to Pub/Sub, which can automatically invoke a Cloud Run service to perform custom capping logic, such as disabling billing or stopping resources.

Step-by-Step Solution

1
Identify Cloud Billing budget capabilities
Recognize that GCP budgets only issue notification emails or publish messages to Cloud Pub/Sub.
Cloud Billing budgets do not natively stop resources or cap spend automatically.
2
Configure programmatic notifications
Connect the budget to a Cloud Pub/Sub topic.
When threshold rules are breached, Cloud Billing publishes JSON payloads to the designated Pub/Sub topic.
3
Connect automation endpoint
Configure the Cloud Run service to be triggered by the Pub/Sub topic messages to execute capping logic.
This establishes an automated event-driven cost governance architecture.

Key Concept

Programmatic Budget Notifications via Cloud Pub/Sub
Estimated Time:1m 30s
Rate this question