Soru

Zorluk: OrtaCreating Billing Budgets, Alerts, and BigQuery Exports

A cloud operations team needs to establish automated cost governance for a Google Cloud project. They want email notifications sent to project billing admins when spending hits 80%80\% of the monthly budget. Additionally, when spending reaches 100%100\%, they require a custom Cloud Function to automatically execute and disable non-essential resources. Which setup represents the Google Cloud recommended approach?

  1. Create a Cloud Billing budget with threshold rules for email alerts, and configure a Cloud Pub/Sub topic on the budget to trigger the Cloud Function when threshold limits are met.Cevap
  2. B
    Create a Cloud Billing budget and enable the built-in automatic resource shutdown toggle on the 100%100\% spending threshold rule.
  3. C
    Enable the Cloud Billing API directly within the target workload project to create local project-specific budget auto-capping policies.
  4. D
    Assign the Project Viewer role to the Cloud Function service account and set up a budget threshold rule that restricts billing permissions upon reaching 100%100\%.

Cevap

Create a Cloud Billing budget with threshold rules for email alerts, and configure a Cloud Pub/Sub topic on the budget to trigger the Cloud Function when threshold limits are met.
Google Cloud Billing budgets provide built-in threshold alerts via email and integrate natively with Cloud Pub/Sub. To perform automated actions like shutting down resources, the budget must publish messages to a Pub/Sub topic, which triggers a Cloud Function or Cloud Run service to execute the required remediation logic.

Adım Adım Çözüm

1
Define the Cloud Billing budget scope and threshold triggers.
Email alert rules are set at 80%80\% and 100%100\% of actual or forecasted costs.
Budgets generate alerts based on specified percentage thresholds of target spend.
2
Attach a Cloud Pub/Sub topic to the Cloud Billing budget notification settings.
Budget alert events publish JSON messages containing cost details to the Pub/Sub topic whenever thresholds are breached.
Pub/Sub integration allows programmatic subscribers to act on billing events.
3
Configure the Cloud Function with a Pub/Sub trigger pointing to the billing topic.
The Cloud Function executes custom code to stop or cap compute resources when receiving a threshold message indicating 100%100\% spend.
GCP billing budgets do not stop billing automatically; custom programmatic logic via Pub/Sub and serverless execution is required for automated remediation.

Anahtar Kavram

Programmatic Budget Notifications via Pub/Sub and Cloud Functions
Tahmini Süre:1m 30s
Bu soruyu puanla