Soru

Zorluk: ZorCreating Billing Budgets, Alerts, and BigQuery Exports

An organization requires strict automated cost controls for its cloud workloads. The finance team specifies that if actual spending in a designated development project reaches 100% of its 5,000monthlybudget,runningvirtualmachineinstancesmustbeimmediatelystoppedtopreventfurthercostaccumulation.ThecloudadministratorcreatesaCloudBillingbudgetwitha5,000 monthly budget, running virtual machine instances must be immediately stopped to prevent further cost accumulation. The cloud administrator creates a Cloud Billing budget with a 5,000 threshold. Which implementation approach should the administrator select to accomplish this automated remediation?

  1. Link the Cloud Billing budget to a Cloud Pub/Sub topic, and write a Cloud Function subscribed to that topic that calls the Compute Engine API to stop active VM instances.Cevap
  2. B
    Configure the budget threshold rule setting in the Cloud Billing Console to automatically cap Compute Engine quota and turn off VM instances when 100% spend is reached.
  3. C
    Grant the Billing Account Viewer role to the project's default Compute Engine service account so it can monitor the budget threshold and execute self-termination.
  4. D
    Enable the Cloud Billing API inside the target project and configure native webhook email endpoints to execute instance teardown upon receiving the notification header.

Cevap

Connect the Cloud Billing budget to a Cloud Pub/Sub topic and deploy a Cloud Function subscribed to that topic to programmatically stop the running instances using the Compute Engine API.
The correct response identifies that Cloud Billing budget alerts do not shut down resources natively. Publishing budget notifications to a Cloud Pub/Sub topic enables custom code (such as a Cloud Function) to receive the event payload, evaluate the spend threshold, and call the Compute Engine API to stop active VM instances.

Adım Adım Çözüm

1
Understand the scope of GCP Billing Budget alert notifications.
Recognize that standard budget alerts only send informational messages and do not perform automated resource termination out of the box.
GCP separates billing notification delivery from resource lifecycle management.
2
Configure programmatic notifications.
Publish budget notifications to a Cloud Pub/Sub topic linked to the billing budget.
Pub/Sub provides an event-driven channel that receives budget notification payloads when threshold percentages are breached.
3
Implement automated remediation logic.
Create a Cloud Function (or Cloud Run service) triggered by the Pub/Sub topic to parse the cost payload and issue stop requests to Compute Engine VMs.
Custom code executing via Cloud Functions can interact with GCP APIs to enforce resource capping and budget compliance.

Anahtar Kavram

Cloud Billing budgets send alert messages but do not natively modify or shut down cloud resources; programmatic enforcement requires Cloud Pub/Sub integration with serverless logic.
Bu soruyu puanla