EventarcTrigger


Property Value
Google Cloud Service Name Eventarc
Google Cloud Service Documentation /eventarc/docs/
Google Cloud REST Resource Name v1.projects.locations.triggers
Google Cloud REST Resource Documentation /eventarc/docs/reference/rest/v1/projects.locations.triggers
Config Connector Resource Short Names gcpeventarctrigger
gcpeventarctriggers
eventarctrigger
Config Connector Service Name eventarc.googleapis.com
Config Connector Resource Fully Qualified Name eventarctriggers.eventarc.cnrm.cloud.google.com
Can Be Referenced by IAMPolicy/IAMPolicyMember No
Config Connector Default Average Reconcile Interval In Seconds 600

Custom Resource Definition Properties

Annotations

Fields
cnrm.cloud.google.com/state-into-spec

Spec

Schema

channelRef:
  external: string
  name: string
  namespace: string
destination:
  cloudFunctionRef:
    external: string
    name: string
    namespace: string
  cloudRunService:
    path: string
    region: string
    serviceRef:
      external: string
      name: string
      namespace: string
  gke:
    clusterRef:
      external: string
      name: string
      namespace: string
    location: string
    namespace: string
    path: string
    service: string
  httpEndpoint:
    uri: string
  networkConfig:
    networkAttachmentRef:
      external: string
      name: string
      namespace: string
  workflowRef:
    external: string
    name: string
    namespace: string
eventDataContentType: string
location: string
matchingCriteria:
- attribute: string
  operator: string
  value: string
projectRef:
  external: string
  name: string
  namespace: string
resourceID: string
serviceAccountRef:
  external: string
  name: string
  namespace: string
transport:
  pubsub:
    topicRef:
      external: string
      name: string
      namespace: string
Fields

channelRef

Optional

object

Immutable.

channelRef.external

Optional

string

Optional. The name of the channel associated with the trigger in `projects/{project}/locations/{location}/channels/{channel}` format. You must provide a channel to receive events from Eventarc SaaS partners.

channelRef.name

Optional

string

[WARNING] EventarcChannel not yet supported in Config Connector, use 'external' field to reference existing resources. Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

channelRef.namespace

Optional

string

Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

destination

Required

object

Required. Destination specifies where the events should be sent to.

destination.cloudFunctionRef

Optional

object

destination.cloudFunctionRef.external

Optional

string

[WARNING] Configuring a Cloud Function in Trigger is not supported as of today. The Cloud Function resource name. Format: projects/{project}/locations/{location}/functions/{function} Allowed value: The Google Cloud resource name of a `CloudFunctionsFunction` resource (format: `projects/{{project}}/locations/{{region}}/functions/{{name}}`).

destination.cloudFunctionRef.name

Optional

string

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

destination.cloudFunctionRef.namespace

Optional

string

Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

destination.cloudRunService

Optional

object

Cloud Run fully-managed service that receives the events. The service should be running in the same project of the trigger.

destination.cloudRunService.path

Optional

string

Optional. The relative path on the Cloud Run service the events should be sent to. The value must conform to the definition of URI path segment (section 3.3 of RFC2396). Examples: "/route", "route", "route/subroute".

destination.cloudRunService.region

Required*

string

Required. The region the Cloud Run service is deployed in.

destination.cloudRunService.serviceRef

Required*

object

destination.cloudRunService.serviceRef.external

Optional

string

Required. The name of the Cloud Run service being addressed. See https://cloud.google.com/run/docs/reference/rest/v1/namespaces.services. Only services located in the same project of the trigger object can be addressed. Allowed value: The Google Cloud resource name of a `RunService` resource (format: `projects/{{project}}/locations/{{location}}/services/{{name}}`).

destination.cloudRunService.serviceRef.name

Optional

string

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

destination.cloudRunService.serviceRef.namespace

Optional

string

Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

destination.gke

Optional

object

A GKE service capable of receiving events. The service should be running in the same project as the trigger.

destination.gke.clusterRef

Required*

object

destination.gke.clusterRef.external

Optional

string

Required. The name of the cluster the GKE service is running in. The cluster must be running in the same project as the trigger being created. Allowed value: The `selfLink` field of a `ContainerCluster` resource.

destination.gke.clusterRef.name

Optional

string

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

destination.gke.clusterRef.namespace

Optional

string

Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

destination.gke.location

Required*

string

Required. The name of the Google Compute Engine in which the cluster resides, which can either be compute zone (for example, us-central1-a) for the zonal clusters or region (for example, us-central1) for regional clusters.

destination.gke.namespace

Required*

string

Required. The namespace the GKE service is running in.

destination.gke.path

Optional

string

Optional. The relative path on the GKE service the events should be sent to. The value must conform to the definition of a URI path segment (section 3.3 of RFC2396). Examples: "/route", "route", "route/subroute".

destination.gke.service

Required*

string

Required. Name of the GKE service.

destination.httpEndpoint

Optional

object

An HTTP endpoint destination described by an URI.

destination.httpEndpoint.uri

Required*

string

Required. The URI of the HTTP enpdoint. The value must be a RFC2396 URI string. Examples: `http://10.10.10.8:80/route`, `http://svc.us-central1.p.local:8080/`. Only HTTP and HTTPS protocols are supported. The host can be either a static IP addressable from the VPC specified by the network config, or an internal DNS hostname of the service resolvable via Cloud DNS.

destination.networkConfig

Optional

object

Optional. Network config is used to configure how Eventarc resolves and connect to a destination. This should only be used with HttpEndpoint destination type.

destination.networkConfig.networkAttachmentRef

Required*

object

destination.networkConfig.networkAttachmentRef.external

Optional

string

Required. Name of the NetworkAttachment that allows access to the destination VPC. Format: `projects/{PROJECT_ID}/regions/{REGION}/networkAttachments/{NETWORK_ATTACHMENT_NAME}`

destination.networkConfig.networkAttachmentRef.name

Optional

string

[WARNING] ComputeNetworkAttachment not yet supported in Config Connector, use 'external' field to reference existing resources. Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

destination.networkConfig.networkAttachmentRef.namespace

Optional

string

Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

destination.workflowRef

Optional

object

destination.workflowRef.external

Optional

string

The resource name of the Workflow whose Executions are triggered by the events. The Workflow resource should be deployed in the same project as the trigger. Format: `projects/{project}/locations/{location}/workflows/{workflow}`

destination.workflowRef.name

Optional

string

[WARNING] WorkflowsWorkflow not yet supported in Config Connector, use 'external' field to reference existing resources. Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

destination.workflowRef.namespace

Optional

string

Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

eventDataContentType

Optional

string

Optional. EventDataContentType specifies the type of payload in MIME format that is expected from the CloudEvent data field. This is set to `application/json` if the value is not defined.

location

Required

string

Immutable. The location for the resource

matchingCriteria

Required

list (object)

Required. null The list of filters that applies to event attributes. Only events that match all the provided filters will be sent to the destination.

matchingCriteria[]

Required

object

matchingCriteria[].attribute

Required

string

Required. The name of a CloudEvents attribute. Currently, only a subset of attributes are supported for filtering. All triggers MUST provide a filter for the 'type' attribute.

matchingCriteria[].operator

Optional

string

Optional. The operator used for matching the events with the value of the filter. If not specified, only events that have an exact key-value pair specified in the filter are matched. The only allowed value is `match-path-pattern`.

matchingCriteria[].value

Required

string

Required. The value for the attribute. See https://cloud.google.com/eventarc/docs/creating-triggers#trigger-gcloud for available values.

projectRef

Required

object

Immutable. The Project that this resource belongs to.

projectRef.external

Optional

string

The project for the resource Allowed value: The Google Cloud resource name of a `Project` resource (format: `projects/{{name}}`).

projectRef.name

Optional

string

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

projectRef.namespace

Optional

string

Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

resourceID

Optional

string

Immutable. Optional. The name of the resource. Used for creation and acquisition. When unset, the value of `metadata.name` is used as the default.

serviceAccountRef

Optional

object

serviceAccountRef.external

Optional

string

Optional. The IAM service account email associated with the trigger. The service account represents the identity of the trigger. The principal who calls this API must have `iam.serviceAccounts.actAs` permission in the service account. See https://cloud.google.com/iam/docs/understanding-service-accounts#sa_common for more information. For Cloud Run destinations, this service account is used to generate identity tokens when invoking the service. See https://cloud.google.com/run/docs/triggering/pubsub-push#create-service-account for information on how to invoke authenticated Cloud Run services. In order to create Audit Log triggers, the service account should also have `roles/eventarc.eventReceiver` IAM role. Allowed value: The `email` field of an `IAMServiceAccount` resource.

serviceAccountRef.name

Optional

string

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

serviceAccountRef.namespace

Optional

string

Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

transport

Optional

object

Immutable. Optional. In order to deliver messages, Eventarc may use other GCP products as transport intermediary. This field contains a reference to that transport intermediary. This information can be used for debugging purposes.

transport.pubsub

Optional

object

Immutable. The Pub/Sub topic and subscription used by Eventarc as delivery intermediary.

transport.pubsub.topicRef

Optional

object

Immutable.

transport.pubsub.topicRef.external

Optional

string

Optional. The name of the Pub/Sub topic created and managed by Eventarc system as a transport for the event delivery. Format: `projects/{PROJECT_ID}/topics/{TOPIC_NAME}. You may set an existing topic for triggers of the type google.cloud.pubsub.topic.v1.messagePublished` only. The topic you provide here will not be deleted by Eventarc at trigger deletion. Allowed value: The Google Cloud resource name of a `PubSubTopic` resource (format: `projects/{{project}}/topics/{{name}}`).

transport.pubsub.topicRef.name

Optional

string

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

transport.pubsub.topicRef.namespace

Optional

string

Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

* Field is required when parent field is specified

Status

Schema

conditions:
- lastTransitionTime: string
  message: string
  reason: string
  status: string
  type: string
createTime: string
etag: string
observedGeneration: integer
resourceConditions:
  string: string
transport:
  pubsub:
    subscription: string
uid: string
updateTime: string
Fields
conditions

list (object)

Conditions represent the latest available observation of the resource's current state.

conditions[]

object

conditions[].lastTransitionTime

string

Last time the condition transitioned from one status to another.

conditions[].message

string

Human-readable message indicating details about last transition.

conditions[].reason

string

Unique, one-word, CamelCase reason for the condition's last transition.

conditions[].status

string

Status is the status of the condition. Can be True, False, Unknown.

conditions[].type

string

Type is the type of the condition.

createTime

string

Output only. The creation time.

etag

string

Output only. This checksum is computed by the server based on the value of other fields, and may be sent only on create requests to ensure the client has an up-to-date value before proceeding.

observedGeneration

integer

ObservedGeneration is the generation of the resource that was most recently observed by the Config Connector controller. If this is equal to metadata.generation, then that means that the current reported status reflects the most recent desired state of the resource.

resourceConditions

map (key: string, value: string)

Output only. The reason(s) why a trigger is in FAILED state.

transport

object

transport.pubsub

object

transport.pubsub.subscription

string

Output only. The name of the Pub/Sub subscription created and managed by Eventarc system as a transport for the event delivery. Format: `projects/{PROJECT_ID}/subscriptions/{SUBSCRIPTION_NAME}`.

uid

string

Output only. Server assigned unique identifier for the trigger. The value is a UUID4 string and guaranteed to remain unchanged until the resource is deleted.

updateTime

string

Output only. The last-modified time.

Sample YAML(s)

Typical Use Case

# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: eventarc.cnrm.cloud.google.com/v1beta1
kind: EventarcTrigger
metadata:
  name: eventarctrigger-sample
  labels:
    foo1: bar1
spec:
  location: us-central1
  destination:
    cloudRunService:
      serviceRef:
        external: eventarctrigger-dep
      region: us-central1
  serviceAccountRef:
    name: eventarctrigger-dep
  transport:
    pubsub:
      topicRef:
        name: eventarctrigger-dep
  matchingCriteria:
  - attribute: "type"
    value: "google.cloud.pubsub.topic.v1.messagePublished"
  projectRef:
    # Replace ${PROJECT_ID?} with your project ID
    external: "projects/${PROJECT_ID?}"
---
apiVersion: iam.cnrm.cloud.google.com/v1beta1
kind: IAMPolicyMember
metadata:
  name: eventarctrigger-dep
spec:
  memberFrom:
    serviceAccountRef:
      name: eventarctrigger-dep
  role: roles/eventarc.admin
  resourceRef:
    kind: Project
    # Replace ${PROJECT_ID?} with your project ID
    external: "${PROJECT_ID?}"
---
apiVersion: iam.cnrm.cloud.google.com/v1beta1
kind: IAMServiceAccount
metadata:
  annotations:
    # Replace ${PROJECT_ID?} with your project ID
    cnrm.cloud.google.com/project-id: ${PROJECT_ID?}
  labels:
    label-one: "value-one"
  name: eventarctrigger-dep
spec:
  displayName: ExampleGSA
---
apiVersion: pubsub.cnrm.cloud.google.com/v1beta1
kind: PubSubTopic
metadata:
  labels:
    label-one: "value-one"
  name: eventarctrigger-dep
---
apiVersion: run.cnrm.cloud.google.com/v1beta1
kind: RunService
metadata:
  name: eventarctrigger-dep
spec:
  ingress: "INGRESS_TRAFFIC_ALL"
  launchStage: "GA"
  location: us-central1
  projectRef:
    # Replace ${PROJECT_ID?} with your project ID
    external: "projects/${PROJECT_ID?}"
  template:
    containers:
      - env:
          - name: "FOO"
            value: "BAR"
        image: "gcr.io/cloudrun/hello"
    scaling:
      maxInstanceCount: 2
  traffic:
    - percent: 100
      type: "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST"