Using path patterns with Storage eventarc triggers while deploying

Hi,

This page specifically mentions a path pattern to match a file in a bucket. How do I use it with the --trigger-event-filters-path-pattern and --trigger-event-filters options while deploying a cloud function?

I posted about this yesterday but for some reason my post was deleted- it doesn't show up anywhere, yet my post count has incremented to one. I think this is a worthwhile question however. Could I get some clarity here? Thanks!

1 1 182
1 REPLY 1

Hello @leelajh,

Take a look at the documentation: Eventarc Triggers Deployment. You can use the following flags to configure Eventarc triggers in the gcloud CLI:

gcloud functions deploy YOUR_FUNCTION_NAME \
--gen2 \
--trigger-event-filters="type=EVENTARC_FILTER_TYPE" \
[--trigger-event-filters=EVENTARC_EVENT_FILTER] \
[--trigger-event-filters-path-pattern=EVENTARC_EVENT_PATH_PATTERN] \
[--trigger-location=EVENTARC_TRIGGER_LOCATION] \
[--trigger-service-account=EVENTARC_TRIGGER_SERVICE_ACCOUNT] \
[--retry] \
...

Make sure that you specify the --gen2 flag when you deploy to Cloud Functions. You must use Cloud Functions (2nd gen) to use Eventarc triggers

If the above option doesn't work, you can contact Google Cloud Support to further look into your case. Hope it helps, thanks!