Soru

Zorluk: ZorCreating Billing Budgets, Alerts, and BigQuery Exports

A cloud engineer needs to configure automated cost-control actions triggered by Cloud Billing budget alerts using a serverless event architecture. Arrange the following deployment steps in the correct chronological order required to set up this workflow.

  1. 1Grant the cloud engineer the Billing Account Administrator or Billing Account Costs Manager IAM role on the Cloud Billing account.
  2. 2Create a Cloud Pub/Sub topic in a dedicated management project to act as the message destination for budget notification payloads.
  3. 3Configure the Cloud Billing budget with specified threshold rules and attach it to the created Cloud Pub/Sub topic.
  4. 4Deploy a Cloud Function subscribed to the Cloud Pub/Sub topic with code logic that parses budget alert JSON payloads and executes resource-capping API calls.

Cevap

The correct sequence starts with granting the appropriate IAM permissions on the Cloud Billing account, followed by creating the destination Cloud Pub/Sub topic, configuring the Cloud Billing budget linked to that Pub/Sub topic, and finally deploying the Cloud Function subscriber to handle automated remediation logic.
The correct order establishes prerequisite security permissions first, provisions the messaging infrastructure second, binds the billing budget alert policy to the Pub/Sub endpoint third, and implements the serverless consumer logic fourth. This sequence ensures all dependency relationships (permissions -> Pub/Sub topic -> budget binding -> event consumer) are satisfied without workflow errors.

Adım Adım Çözüm

1
Ensure IAM administrative access for Cloud Billing.
The engineer has permission to manage billing budget alerts and export configurations.
Without roles such as Billing Account Costs Manager or Billing Account Administrator, budget modifications and pub/sub sink settings cannot be saved.
2
Provision the Cloud Pub/Sub notification endpoint.
A Pub/Sub topic is established to receive automated JSON alert messages from Google Cloud Billing.
Google Cloud Billing budgets require an existing Pub/Sub topic identifier when attaching a programmatic notification channel.
3
Create the Cloud Billing budget and link the Pub/Sub topic.
Budget threshold rules are active and configured to publish messages to the Pub/Sub topic when spending targets are met.
Budget alert policies send events to the Pub/Sub topic only after explicit association in the billing console or gcloud command.
4
Deploy the event-driven subscriber logic via Cloud Functions.
An automated listener receives Pub/Sub event notifications and executes administrative actions to stop workloads or cap costs.
Budget notifications do not automatically stop resources by default; custom code in Cloud Functions/Run is required to parse notifications and invoke GCP APIs to enforce cost limits.

Anahtar Kavram

Programmatic Billing Budget Notifications and Automated Remediation Workflow
Bu soruyu puanla