Search code examples
google-cloud-platformgoogle-cloud-firestoregoogle-cloud-run

Eventarc to trigger Cloud Run by Firestore document creation event


I am trying to set up a basic Eventarc trigger for triggering Cloud Run when a new Firestore document is added.

I set it up as depicted in the screenshot below (region: global; resource: any). Then I create a new document in Firestore (database location: europe-west3). The Cloud Run service in europe-north1 does not get triggered; moreover, no information about the event shows up in the trigger monitoring (see the screenshot).

What am I doing wrong?

Firestore log: enter image description here

Trigger details: enter image description here


Solution

  • It took me a day, but here is the thing. To use Eventarc for Firestore events, you need to enable Compute Engine API audit logging, NOT the Firestore/Datastore API. You can do that in IAM and admin -> Audit logs.

    It does not seem self-evident to me. It would be nice if the documentation had that explicitly about the Firestore vs. Compute Engine APIs.

    Here is the configuration that works: enter image description here

    enter image description here