gcloud eventarc triggers create Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud eventarc triggers create - create an Eventarc trigger
- SYNOPSIS
gcloud eventarc triggers create(TRIGGER:--location=LOCATION)--event-filters=[ATTRIBUTE=VALUE,…]([--destination-gke-cluster=DESTINATION_GKE_CLUSTER--destination-gke-service=DESTINATION_GKE_SERVICE:--destination-gke-location=DESTINATION_GKE_LOCATION--destination-gke-namespace=DESTINATION_GKE_NAMESPACE--destination-gke-path=DESTINATION_GKE_PATH] | [--destination-http-endpoint-uri=DESTINATION_HTTP_ENDPOINT_URI:--network-attachment=NETWORK_ATTACHMENT] | [--destination-run-service=DESTINATION_RUN_SERVICE:--destination-run-path=DESTINATION_RUN_PATH--destination-run-region=DESTINATION_RUN_REGION] | [--destination-workflow=DESTINATION_WORKFLOW:--destination-workflow-location=DESTINATION_WORKFLOW_LOCATION])[--async][--channel=CHANNEL][--event-data-content-type=EVENT_DATA_CONTENT_TYPE][--event-filters-path-pattern=[ATTRIBUTE=PATH_PATTERN,…]][--labels=[KEY=VALUE,…]][--max-retry-attempts=MAX_RETRY_ATTEMPTS][--service-account=SERVICE_ACCOUNT][--transport-topic=TRANSPORT_TOPIC][GCLOUD_WIDE_FLAG …]
- DESCRIPTION
- Create an Eventarc trigger.
- EXAMPLES
- To create a new trigger
forevents of typemy-triggerwith destination Cloud Run servicegoogle.cloud.pubsub.topic.v1.messagePublished, run:my-servicegcloudeventarctriggerscreatemy-trigger--event-filters="type=google.cloud.pubsub.topic.v1.messagePublished"--destination-run-service=my-service - POSITIONAL ARGUMENTS
- Trigger resource - The trigger to create. The arguments in this group can beused to specify the attributes of this resource. (NOTE) Some attributes are notgiven arguments in this group but can be set in other ways.
To set the
projectattribute:- provide the argument
triggeron the command line with a fullyspecified name; - provide the argument
--projecton the command line; - set the property
core/project.
This must be specified.
TRIGGER- ID of the trigger or fully qualified identifier for the trigger.
To set the
triggerattribute:- provide the argument
triggeron the command line.
This positional argument must be specified if any of the other arguments in thisgroup are specified.
- provide the argument
--location=LOCATION- The location for the Eventarc trigger, which should be either
or one of the supported regions.Alternatively, set the [eventarc/location] property.globalTo set the
locationattribute:- provide the argument
triggeron the command line with a fullyspecified name; - provide the argument
--locationon the command line; - set the property
eventarc/location.
- provide the argument
- provide the argument
- Trigger resource - The trigger to create. The arguments in this group can beused to specify the attributes of this resource. (NOTE) Some attributes are notgiven arguments in this group but can be set in other ways.
- REQUIRED FLAGS
--event-filters=[ATTRIBUTE=VALUE,…]- The trigger's list of filters that apply to CloudEvents attributes. This flagcan be repeated to add more filters to the list. Only events that match allthese filters will be sent to the destination. The filters must include the
attribute, as well as any otherattributes that are expected for the chosen type.type - Flags for specifying the destination to which events should be sent.
Exactly one of these must be specified:
- Flags for specifying a GKE service destination.
--destination-gke-cluster=DESTINATION_GKE_CLUSTER- Name of the GKE cluster that the destination GKE service is running in. Thecluster must be in the same project as the trigger.
This flag argument must be specified if any of the other arguments in this groupare specified.
--destination-gke-service=DESTINATION_GKE_SERVICE- Name of the destination GKE service that receives the events for the trigger.
This flag argument must be specified if any of the other arguments in this groupare specified.
--destination-gke-location=DESTINATION_GKE_LOCATION- Location of the GKE cluster that the destination GKE service is running in. Ifnot specified, it is assumed that the cluster is a regional cluster and is inthe same region as the trigger.
--destination-gke-namespace=DESTINATION_GKE_NAMESPACE- Namespace that the destination GKE service is running in. If not specified, the
namespace is used.default --destination-gke-path=DESTINATION_GKE_PATH- Relative path on the destination GKE service to which the events for the triggershould be sent. Examples:
,/route,route.route/subroute - Flags for specifying a HTTP Endpoint destination.
--destination-http-endpoint-uri=DESTINATION_HTTP_ENDPOINT_URI- URI that the destination HTTP Endpoint is connecting to.
This flag argument must be specified if any of the other arguments in this groupare specified.
- Flags for specifying a Network Config for the destination.
--network-attachment=NETWORK_ATTACHMENT- The network attachment associated with the trigger that allows access to thedestination VPC.
- Flags for specifying a Cloud Run fully-managed resource destination.
--destination-run-service=DESTINATION_RUN_SERVICE- Name of the Cloud Run fully-managed service that receives the events for thetrigger. The service must be in the same project as the trigger.
This flag argument must be specified if any of the other arguments in this groupare specified.
--destination-run-path=DESTINATION_RUN_PATH- Relative path on the destination Cloud Run service to which the events for thetrigger should be sent. Examples:
,/route,route.route/subroute --destination-run-region=DESTINATION_RUN_REGION- Region in which the destination Cloud Run service can be found. If notspecified, it is assumed that the service is in the same region as the trigger.
- Flags for specifying a Cloud Workflows destination.
--destination-workflow=DESTINATION_WORKFLOW- ID of the workflow that receives the events for the trigger. The workflow mustbe in the same project as the trigger.
This flag argument must be specified if any of the other arguments in this groupare specified.
--destination-workflow-location=DESTINATION_WORKFLOW_LOCATION- Location that the destination workflow is running in. If not specified, it isassumed that the workflow is in the same location as the trigger.
- OPTIONAL FLAGS
--async- Return immediately, without waiting for the operation in progress to complete.
- Channel resource - The channel to use in the trigger. The channel is needed onlyif trigger is created for a third-party provider. This represents a Cloudresource. (NOTE) Some attributes are not given arguments in this group but canbe set in other ways.
To set the
projectattribute:- provide the argument
--channelon the command line with a fullyspecified name; - provide the argument
--projecton the command line; - set the property
core/project.
To set the
locationattribute:- provide the argument
--channelon the command line with a fullyspecified name; - provide the argument
--locationon the command line; - set the property
eventarc/location.
- provide the argument
--channel=CHANNEL- ID of the channel or fully qualified identifier for the channel.
To set the
channelattribute:- provide the argument
--channelon the command line.
- provide the argument
--event-data-content-type=EVENT_DATA_CONTENT_TYPE- Depending on the event provider, you can specify the encoding of the event datapayload that will be delivered to your destination, to either be encoded in
orapplication/json. The default encodingisapplication/protobuf. Note that for customsources or third-party providers, or for direct events from Cloud Pub/Sub, thisformatting option is not supported.application/json --event-filters-path-pattern=[ATTRIBUTE=PATH_PATTERN,…]- The trigger's list of filters in path pattern format that apply to CloudEventattributes. This flag can be repeated to add more filters to the list. Onlyevents that match all these filters will be sent to the destination. Currently,path pattern format is only available for the resourceName attribute for CloudAudit Log events.
--labels=[KEY=VALUE,…]- List of label KEY=VALUE pairs to add.
Keys must start with a lowercase character and contain only hyphens(
-), underscores (_), lowercase characters, andnumbers. Values must contain only hyphens (-), underscores(_), lowercase characters, and numbers. - The retry policy configuration for the trigger. Can only be set for Cloud Rundestinations.
--max-retry-attempts=MAX_RETRY_ATTEMPTS- The maximum number of delivery attempts. The only valid value is 1.
--service-account=SERVICE_ACCOUNT- The IAM service account email associated with the trigger.
- Pub/Sub topic resource - The Cloud Pub/Sub topic to use for the trigger'stransport intermediary. This feature is currently only available for triggers ofevent type
.The topic must be in the same project as the trigger. If not specified, atransport topic will be created. This represents a Cloud resource. (NOTE) Someattributes are not given arguments in this group but can be set in other ways.google.cloud.pubsub.topic.v1.messagePublishedTo set the
projectattribute:- provide the argument
--transport-topicon the command line with afully specified name; - provide the argument
--projecton the command line; - set the property
core/project.
- provide the argument
--transport-topic=TRANSPORT_TOPIC- ID of the Pub/Sub topic or fully qualified identifier for the Pub/Sub topic.
To set the
transport-topicattribute:- provide the argument
--transport-topicon the command line.
- provide the argument
- GCLOUD WIDE FLAGS
- These flags are available to all commands:
--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.Run
$gcloud helpfor details.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-18 UTC.