I have GCP bucket, and I need to trigger Slack notification (using Cloud Build) if a new object created in certain folder. For example:
gs://mybucket/myfolder/example.zip
gs://mybucket/blah/myfolder/example.zip
gs://mybucket/blah/blah/myfolder/example.zip
So:
- I created Pub/Sub notification (https://cloud.google.com/…/buckets/notifications/create)
- I created Cloud Build job triggered by this Pub/Sub topic
Very simple, but - it seems that OBJECT_PREFIX doesn’t support wildcards, i.e.
gcloud storage buckets notifications create gs://mybucket --object-prefix=myfolder/ …
works for gs://mybucket/myfolder/myfile.zip but not for gs://mybucket/blah/myfolder/myfile.zip
Any ideas? (Yes, I can trigger w/o object prefix and filter relevant events in my cloud build job, but I don’t want to trigger million jobs.)