Manage triggers

Eventarc has various methods for managing triggers using either the Google Cloud Console or the Google Cloud CLI.

Delete a trigger

You can delete a trigger.

Console

  1. In the Cloud Console, go to the Eventarc Triggers page.

    Go to Eventarc
  2. Select the trigger and click Delete.

gcloud

gcloud eventarc triggers delete TRIGGER

Replace TRIGGER with the ID of the trigger or a fully qualified identifier.

List triggers

You can list, filter, and sort through your triggers in all locations.

Console

  • To list all your triggers, in the Cloud Console, go to the Eventarc Triggers page.

    Go to Eventarc

    This command lists your trigger name, region, event provider, destination information, and type in all locations.

  • To filter your triggers by name, region, or created date:
    1. Click Filter text box.
    2. From the list of Properties, select an option to filter the triggers.

    You can select a single property or use the logical operator OR to add more properties and filter.

  • To sort your triggers by name, region, or created date, click Sort beside Name, Region, and Created.

gcloud

gcloud eventarc triggers list --location=-

This command lists your trigger name, type, destination, and status in all locations.

Describe a trigger

You can describe a trigger in a specific location.

Console

  1. In the Cloud Console, go to the Eventarc Triggers page.

    Go to Eventarc
  2. From the list of triggers, click the trigger you want to know the details about.

The Trigger details page displays the details of the trigger such as name, event provider, and trigger destination.

gcloud

gcloud eventarc triggers describe TRIGGER \
--location=LOCATION

Replace the following:

  • TRIGGER: the ID of the trigger or a fully qualified identifier.
  • LOCATION: the location of the Eventarc trigger.

This command returns the following information about the trigger:

  • Time of creation of the trigger
  • Details of the trigger destination
  • Matching criteria such as event filters
  • Name of the trigger
  • Service account email associated with the trigger
  • Details of the transport layer such as Pub/Sub subscription and topic names.

Update a trigger

You can update a trigger for Cloud Run, Cloud Run for Anthos, and Workflows targets.

Console

  1. In the Cloud Console, go to the Eventarc Triggers page.

    Go to Eventarc
  2. From the list of triggers, click the trigger you want to know the details about.
  3. On the Trigger details page, click Edit.
  4. Edit fields as required and click Save.

    Note that you cannot update the Event provider, Event, Cloud Pub/Sub topic, Bucket, Region, and Event destination fields. For more information on the fields, see Create triggers using the Google Cloud Console.

gcloud

Cloud Run

gcloud eventarc triggers update TRIGGER \
  --location=LOCATION \
  --event-filters=NEW_EVENT_FILTERS \
  --service-account=NEW_SERVICE_ACCOUNT \
  --destination-run-region=NEW_REGION \
  --destination-run-service=NEW_SERVICE \
  --destination-run-path=NEW_PATH

Replace the following:

  • TRIGGER: the ID of the trigger or a fully qualified identifier.
  • LOCATION: the location of the Eventarc trigger.

You can update any of the following:

  • NEW_EVENT_FILTERS: the filter used to configure the event routing of the trigger; for example, type=google.cloud.pubsub.topic.v1.messagePublished.
  • NEW_SERVICE_ACCOUNT: the Identity and Access Management (IAM) service account email associated with the trigger.
  • NEW_REGION: the region in which the destination Cloud Run service can be found.
  • NEW_SERVICE: the name of the Cloud Run service that receives the events for the trigger.
  • NEW_PATH: the relative path on the destination Cloud Run service to which the events for the trigger should be sent.

For example, to update the trigger with a new service account:

gcloud eventarc triggers update cal-events-trigger \
  --service-account=new-serviceaccount@${PROJECT_ID}.iam.gserviceaccount.com

This command updates a trigger named cal-events-trigger with a service account, new-serviceaccount@PROJECT_ID.iam.gserviceaccount.com.

Cloud Run for Anthos

gcloud eventarc triggers update TRIGGER \
  --location=LOCATION \
  --destination-gke-namespace=NEW_NAMESPACE \
  --destination-gke-service=NEW_SERVICE \
  --destination-gke-path=NEW_PATH

Replace the following:

  • TRIGGER: the ID of the trigger or a fully qualified identifier.
  • LOCATION: the location of the Eventarc trigger.

You can update any of the following:

  • NEW_NAMESPACE: the namespace in which the destination Cloud Run for Anthos service is running.
  • NEW_SERVICE: the name of the Cloud Run for Anthos service that receives the events for the trigger.
  • NEW_PATH: the relative path on the destination Cloud Run for Anthos service to which the events for the trigger should be sent.

For example, to update the trigger with a new service:

gcloud eventarc triggers update cal-events-trigger \
  --destination-gke-service=helloworld-events

This command updates a trigger named cal-events-trigger with a new Cloud Run for Anthos service named, helloworld-events that receives the events for the trigger.

Workflows

gcloud eventarc triggers update TRIGGER
  --location=LOCATION \
  --event-filters=NEW_EVENT_FILTERS \
  --service-account=NEW_SERVICE_ACCOUNT \
  --destination-workflow=NEW_DESTINATION_WORKFLOW  \
  --destination-workflow-location=NEW_DESTINATION_WORKFLOW_LOCATION

Replace the following:

  • TRIGGER: the ID of the trigger or a fully qualified identifier.
  • LOCATION: the location of the Eventarc trigger.

You can update any of the following:

  • NEW_EVENT_FILTERS: the filter used to configure the event routing of the trigger; for example, type=google.cloud.pubsub.topic.v1.messagePublished.
  • NEW_SERVICE_ACCOUNT: the Identity and Access Management (IAM) service account email associated with the trigger.
  • NEW_DESTINATION_WORKFLOW: the ID of the deployed workflow that receives the events from the trigger.
  • NEW_DESTINATION_WORKFLOW_LOCATION: the location in which the destination workflow is deployed.

For example, to update the trigger with a new service account:

gcloud eventarc triggers update cal-workflows-trigger \
  --service-account="${TRIGGER_SA}@${PROJECT_ID}.iam.gserviceaccount.com"

This updates a trigger named cal-workflows-trigger with a service account, new-serviceaccount@PROJECT_ID.iam.gserviceaccount.com.