Configure an Eventarc trigger
This page describes how to configure an Eventarc trigger in Application Integration.
An Eventarc trigger lets you run integrations based on events routed through Eventarc Standard. Using an Eventarc trigger, you can build integration flows triggered by events from various Google Cloud services, third-party services, and custom event sources. For example, you can use the trigger to initiate an integration when a new object is uploaded to a Cloud Storage bucket.
In the Google Cloud console, you can create and configure an Eventarc trigger in the following ways:
Before you begin
Before configuring the Eventarc trigger, enable the Eventarc API and the Pub/Sub API:
Roles required to enable APIs
To enable APIs, you need the serviceusage.services.enable permission. If you
created the project, then you likely already have this permission through the
Owner role (roles/owner). Otherwise, you can get this permission through the
Service Usage Admin role (roles/serviceusage.serviceUsageAdmin).
Learn how to grant roles.
Considerations
Consider the following when configuring an Eventarc trigger:
-
If creating the Eventarc trigger fails during integration publication due to
configuration errors, your integration will still publish, but the trigger won't be active.
To fix this, unpublish the integration, carefully review and correct the Eventarc trigger configuration, and then republish the integration. You can check the Eventarc trigger creation status by clicking (Notification) in the Google Cloud console tool bar.
- Publishing a new version of your integration with a modified Eventarc trigger configuration automatically replaces the old trigger with a new one. This ensures your integration always uses the latest trigger configuration and deletes any obsolete triggers.
- If you publish a new version of your integration and use the same Eventarc trigger and its configuration, a new trigger isn't created. Instead, the existing Eventarc trigger is reused for your new integration version.
Create an Eventarc trigger from Application Integration
To create an Eventarc trigger from Application Integration, do the following steps:
- Add the Eventarc trigger in Application Integration
- Configure the Eventarc trigger in the integration editor
Add the Eventarc trigger
To add an Eventarc trigger to your integration, complete the following steps:
- In the Google Cloud console, go to the Application Integration page.
- In the navigation menu, click Integrations
The Integrations List page appears listing all the integrations available in the Google Cloud project.
- Select an existing integration or click Create integration to create a new one.
If you are creating a new integration:
- Enter a name and description in the Create Integration pane.
- Select a region for the integration.
- Select a service account for the integration. You can change or update the service account details of an integration any time from the Integration summary pane in the integration toolbar.
- Click Create.
The newly created integration opens in the integration editor.
- In the integration editor navigation bar, click Triggers to view the list of available triggers.
- Drag and drop the Eventarc element in the integration editor.
Configure the Eventarc trigger
To configure an Eventarc trigger, click the Eventarc Trigger element in the integration editor. The Eventarc Trigger configuration pane appears showing the following fields:
- Label: (optional) the visible name of the Eventarc trigger in your integration. You can change the label to a name of your choice.
- Notes: (optional) you can add notes to provide additional information about the trigger.
- Click Configure Eventarc trigger and provide the following inputs in the Eventarc trigger editor:
- Trigger name: enter a name for the trigger.
- Trigger type: select one of the following trigger types:
- Google source: select this option to create a trigger for Pub/Sub, Cloud Storage, Firestore, and other Google event providers.
- Custom: select this option to create a trigger for a custom event source.
- Third-party: select this option to create a trigger for non-Google providers that offer an Eventarc source. For more information, see Third-party events in Eventarc.
- Event provider: select the event provider for the trigger. The list of event providers depends on the trigger type. For more information, see Event providers and destinations.
- Event type: select the event type for the trigger. Your trigger configuration varies based on the event provider you select. For more information, see Event types.
- Region: select the region for the trigger.
- Filters: (optional) add filters to select the APIs that match your criteria. For example, if you filter the APIs by a specific name, the event is triggered only if the APIs matching the filter criteria are updated.
- Service account: select the service account to use for the trigger. If you don't select a service account, the trigger uses the Compute Engine default service account as its identity when invoking your service. The service account associated with the trigger must have the required permissions to invoke your service.
- Retry on failure: select to enable trigger retries if the destination fails to process the event.
- Network attachment: select the network attachment to use for the trigger. This list is generated based on the network attachments created in your project.
Network attachments facilitate communication between service producer Virtual Private Cloud (VPC) networks and consumer VPC networks. Eventarc uses the configured network attachment to establish a connection to an internal HTTP endpoint hosted within the consumer's VPC network, enabling delivery of event data. For more information about creating and managing network attachments, see Create and manage network attachments.
- To save the trigger configuration, click Save trigger.
Create an Eventarc trigger using the Eventarc console
To create an Eventarc trigger from the Eventarc console page, do the following steps:
- In the Google Cloud console, go to the Eventarc > Triggers page.
The Triggers page lists all the triggers in your project.
- Click Create trigger.
- In the Create trigger page, provide the following inputs:
- Trigger name: enter a name for the trigger.
- Trigger type: select one of the following trigger types:
- Google sources: select this option to create a trigger for Pub/Sub, Cloud Storage, Firestore, and other Google event providers.
- Custom: select this option to create a trigger for a custom event source.
- Third-party: select this option to create a trigger for non-Google providers that offer an Eventarc source. For more information, see Third-party events in Eventarc.
- Event provider: select the event provider for the trigger. The list of event providers depends on the trigger type. For more information, see Event providers and destinations.
- Event type: select the event type for the trigger. Your trigger configuration varies based on the event provider you select. For more information, see Event types.
- Event data content type: select the data type for the event content. Select either application/json or application/protobuf.
- Region: select the region for the trigger.
- Service account: select the service account to use for the trigger. If you don't select a service account, the trigger uses the Compute Engine default service account as its identity when invoking your service. The service account associated with the trigger must have the required permissions to invoke your service.
- Event destination: select Application Integration.
- Select an Integration: select the integration for which you want to create the trigger. If the integration is published, Application Integration creates a new draft version of the integration to add the Eventarc trigger to.
- Network attachment: select the network attachment to use for the trigger. This list
is generated based on the network attachments created in your project.
Network attachments facilitate communication between service producer Virtual Private Cloud (VPC) networks and consumer VPC networks. Eventarc uses the configured network attachment to establish a connection to an internal HTTP endpoint hosted within the consumer's VPC network, enabling delivery of event data. For more information about network attachments, see About network attachments.
- Click Open integration.
The Application Integration editor page opens with the integration selected and the new Eventarc trigger element added to the integration.
- Click the Eventarc trigger element and open the trigger configuration pane.
- Review and verify the trigger configuration in the Eventarc trigger editor page.
- Connect the new Eventarc trigger to your integration flow and publish the integration.