An Eventarc trigger declares your interest in a certain event or set of events. As a subscriber of events from third-party providers who offer an Eventarc source, you can configure event routing by specifying filters for the trigger including the event source, a destination, and a channel. The channel is a Google Cloud resource through which the provider interacts with a subscriber's project. By creating and activating a channel, you makes an explicit request to receive events from a provider. For more details, see Third-party events in Eventarc.
Requests to your service are triggered according to the event types set by the third-party provider. When triggered, Eventarc routes these events through Pub/Sub subscriptions to various destinations while managing delivery, security, authorization, observability, and error-handling for you.
You can create an Eventarc trigger by using the Google Cloud CLI.
Prepare to create a trigger
Depending on the destination you choose to send the events to, complete these prerequisites.
Cloud Run
- Enable the APIs.
- Grant the
roles/eventarc.adminrole to the user. - Create a service account and grant the required roles, permissions, and flags for authenticated and unauthenticated invocations.
GKE
- Enable Workload Identity on your Google Kubernetes Engine cluster.
- Enable the Eventarc API.
- Grant the
roles/eventarc.adminrole to the user. - Create a service account.
- Enable GKE destinations.
Workflows
- Enable the APIs.
- Grant the
roles/eventarc.adminrole to the user. - Create a service account.
For more information, follow the instructions when creating a trigger for a specific provider, event type, and destination and refer to the "Prepare to create a trigger" section.
Create a trigger using gcloud
You can create a trigger by running a gcloud command along with required and
optional flags.