You can create an Eventarc trigger that enables a Cloud Run function to be triggered by an event supported by Eventarc. Note that you must configure a trigger when you create or deploy a function using the Google Cloud CLI or the Google Cloud console.
You can also trigger Cloud Run functions in response to custom events published to an Eventarc channel.
Create an Eventarc trigger
Create an Eventarc trigger so that your Cloud Run functions service receives notifications of a specific event or set of events. By specifying filters for the trigger, you can configure the routing of the event, including the event type and source. For more information on how to configure an Eventarc trigger for Cloud Run functions, see Eventarc triggers.
The following event types trigger requests to your service:
- An audit log is created that matches the trigger's filter criteria
- A direct event occurs such as an update to a Cloud Storage bucket or an update to a Firebase Remote Config template
- A message is published to a Pub/Sub topic
Trigger functions with custom events
You can trigger Cloud Run functions in response to custom events. These are events produced by special or additional event providers, as opposed to the built-in Firebase events supported by the Firebase SDK for Cloud Run functions, and that are published to an Eventarc channel. For more information, see Create and handle custom event triggers. Note that for custom events provided by Firebase Extensions, you should refer to the extension's documentation for a list of events (if any) that it publishes. For example, see the event types for the Run Payments with Stripe extension.