I'm trying to use cloud functions for a personal project, but that requires upgrading to the Blaze plan. I'd like to make sure I don't get unexpectedly charged, so I've been looking into capping the billing for GCP (I've made the mistakes of accidentally set up infinite loops in my code that repeatedly modified Firebase databases). The documentation is confusing for me at two points:
Depending on your runtime, the GCP_PROJECT environment variable might be set automatically. Review the list of environment variables set automatically and determine if you need to manually set the GCP_PROJECT variable to the project for which you want to cap (disable) Cloud Billing.
Since the runtime environment is Node v10, am I supposed to add GCP_PROJECT as an environment variable to the stopBilling cloud function? Would its value just be the project ID?
When the budget sends out a notification, the specified project will no longer have a Cloud Billing account. If you want to test the function, publish a sample message with the testing message above. The project will no longer be visible under the Cloud Billing account and resources in the project are disabled, including the Cloud Function if it's in the same project.
Is "the testing message above" referring to the message in 'Test your Cloud Function'? If so, it hasn't been working for me. I don't even receive any budget notifications from the testing message (should they be showing up in my email?)