问题
I am not sure how technical this question is, but posting it here to request help from firebase / google cloud experts can help me. I have started with cloud functions in Aug 2020 and was able to successfully deploy cloud functions and test without the need for cloud storage. But yesterday I observed that on Sep 17th, 2020, 2 buckets were created in cloud storage and I have been billed for these buckets. There was no change in the way I deployed the cloud functions nor was there any change that I was aware of, to the account.
The service that created the buckets is service-xxxx@gcf-admin-robot.iam.gserviceaccount.com
and the buckets created were:
- gcf-sources-xxxx-us-central1
- us.artifacts.abc.appspot.com
If this service and the buckets are deleted, then I am not able to deploy the functions with the error:
Deployment error. Error when configuring GCS bucket gcf-sources-xxxx-us-central1 in project ABC. Cause: service-xxxx@gcf-admin-robot.iam.gserviceaccount.com does not have storage.buckets.create access to the Google Cloud project.
If I add the service back, then the buckets are getting created, and am able to deploy the functions.
Are cloud storage buckets necessary for cloud functions to work? If not, how can I go back to where I was before these changes occurred. Please guide me.
回答1:
These buckets and their contents are created by Cloud Build, and the Container Registry that is uses internally. Cloud Build is used for Cloud Functions that use Node.js 10 or a later engine.
If you don't want these artifacts to be created you can for the moment still instruct Cloud Functions to deploy/run with Node.js 8. This ability will however disappear in Q1 2021, at which point the new build process is the only way to deploy Cloud Functions.
I recommend reading the FAQ on Cloud Functions pricing for full details on this change.
来源:https://stackoverflow.com/questions/64075335/firebase-cloud-functions-without-cloud-storage