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 of the monthly budget. Additionally, when spending reaches , they require a custom Cloud Function to automatically execute and disable non-essential resources. Which setup represents the Google Cloud recommended approach?
- 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.Answer
- BCreate a Cloud Billing budget and enable the built-in automatic resource shutdown toggle on the spending threshold rule.
- CEnable the Cloud Billing API directly within the target workload project to create local project-specific budget auto-capping policies.
- DAssign the Project Viewer role to the Cloud Function service account and set up a budget threshold rule that restricts billing permissions upon reaching .
Answer
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.
Step-by-Step Solution
Key Concept
Programmatic Budget Notifications via Pub/Sub and Cloud Functions
Estimated Time:1m 30s