Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Cloud Run - Trigger with Eventarc API (resourceName syntax)

Tags:

Google recently released the new Eventarc API trigger for e.g Cloud run. I had the idea to build one trigger for my cloud storage like: new file in bucket → trigger cloud run (with audit log trigger)

cloud_run_path: ...run.app/api/v1/data-fetcher bucket_id: test-bucket

I just created the trigger with the following command and it is successful:

gcloud beta eventarc triggers create test-event-trigger \
--location=europe-west1 \
--destination-run-service=test-event-data-fetcher \
--destination-run-path=/api/v1/data-fetcher \
--destination-run-region=europe-west1 \
--matching-criteria="type=google.cloud.audit.log.v1.written" \
--matching-criteria="serviceName=storage.googleapis.com" \
--matching-criteria="methodName=storage.objects.create" \
--matching-criteria="resourceName=projects/_/buckets/test-bucket" \
--service-account=$PROJECT_NR-compute@developer.gserviceaccount.com

The problem is, I don't want the trigger to look for new files in all buckets in the project, just for one specific bucket (e.g test-bucket). I tested now several options with different writings (with :, =~, ...), but the trigger don't accept these. Maybe you can help me out with the syntax or show me way how its possible to create a Trigger for one specific bucket in my project? Like this it's not working...

like image 623
Rookez Avatar asked Nov 04 '20 12:11

Rookez


1 Answers

As of this time (2020-11) wild cards and prefix matching are not supported in the configuration of the trigger. It appears that this feature has been heavily requested and is apparently known to the product manager at Google that owns this product area. There is no public/committed date for when such a feature will be added. If this is a blocker for you, contact your local Google rep and they can schedule a call with the Product Manager to discuss the road map.

like image 187
Kolban Avatar answered Sep 30 '22 15:09

Kolban