Hi, is there good way to trigger cloud function on the bucket folder level for 2nd gen? Thank you!
Assuming you mean a Cloud Storage bucket there are two ways.
1. You can write an event driven function based on these event types- https://cloud.google.com/functions/docs/calling/storage
2. [Easier Way] Cloud Functions (2nd gen) supports Eventarc. You can choose a pre-implemented GCP event from the UI or CLI to trigger the function. Here is a tutorial you can follow - https://codelabs.developers.google.com/triggering-cloud-functions-from-cloud-storage#0
yeah, I'm talking about the GCS triggering, thank you @rachelt1 for the suggestions! Those are helpful for me to dig into!
Here is additional documentation on how to create a cloud storage event from Eventarc with Cloud Functions (2nd gen) - this is what I recommend
1. Doc about eventarc and 2nd gen -
https://cloud.google.com/functions/docs/calling/eventarc
2. Doc about how to create eventarc trigger from UI or CLI -
https://cloud.google.com/eventarc/docs/functions/create-triggers
Awesome! Thank you very much for the additional info. Used the cloud functions in some of my old projects while it was still in the 1st gen, so glad to see we developed to add more functionalities into the 2nd gen now.
Hello,
Please help me with my query.
We have configured Cloud function to be triggered based on event on cloud storage.
its working for event type (on finalising/creating) but not getting triggered for event type(on deletion) on same bucket.
I m suspecting it due to versioning being enabled for bucket. Please suggest.
Regards,