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,000 threshold. Which implementation approach should the administrator select to accomplish this automated remediation?
- 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
- BConfigure 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.
- CGrant 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.
- DEnable 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
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.