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
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 | |
---|---|
Optional |
Immutable. |
Optional |
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. |
Optional |
[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 |
Optional |
Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ |
Required |
Required. Destination specifies where the events should be sent to. |
Optional |
|
Optional |
[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}}`). |
Optional |
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names |
Optional |
Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ |
Optional |
Cloud Run fully-managed service that receives the events. The service should be running in the same project of the trigger. |
Optional |
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". |
Required* |
Required. The region the Cloud Run service is deployed in. |
Required* |
|
Optional |
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}}`). |
Optional |
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names |
Optional |
Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ |
Optional |
A GKE service capable of receiving events. The service should be running in the same project as the trigger. |
Required* |
|
Optional |
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. |
Optional |
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names |
Optional |
Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ |
Required* |
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. |
Required* |
Required. The namespace the GKE service is running in. |
Optional |
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". |
Required* |
Required. Name of the GKE service. |
Optional |
An HTTP endpoint destination described by an URI. |
Required* |
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. |
Optional |
Optional. Network config is used to configure how Eventarc resolves and connect to a destination. This should only be used with HttpEndpoint destination type. |
Required* |
|
Optional |
Required. Name of the NetworkAttachment that allows access to the destination VPC. Format: `projects/{PROJECT_ID}/regions/{REGION}/networkAttachments/{NETWORK_ATTACHMENT_NAME}` |
Optional |
[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 |
Optional |
Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ |
Optional |
|
Optional |
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}` |
Optional |
[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 |
Optional |
Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ |
Optional |
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. |
Required |
Immutable. The location for the resource |
Required |
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. |
Required |
|
Required |
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. |
Optional |
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`. |
Required |
Required. The value for the attribute. See https://cloud.google.com/eventarc/docs/creating-triggers#trigger-gcloud for available values. |
Required |
Immutable. The Project that this resource belongs to. |
Optional |
The project for the resource Allowed value: The Google Cloud resource name of a `Project` resource (format: `projects/{{name}}`). |
Optional |
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names |
Optional |
Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ |
Optional |
Immutable. Optional. The name of the resource. Used for creation and acquisition. When unset, the value of `metadata.name` is used as the default. |
Optional |
|
Optional |
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. |
Optional |
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names |
Optional |
Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ |
Optional |
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. |
Optional |
Immutable. The Pub/Sub topic and subscription used by Eventarc as delivery intermediary. |
Optional |
Immutable. |
Optional |
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}}`). |
Optional |
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names |
Optional |
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 |
Conditions represent the latest available observation of the resource's current state. |
conditions[] |
|
conditions[].lastTransitionTime |
Last time the condition transitioned from one status to another. |
conditions[].message |
Human-readable message indicating details about last transition. |
conditions[].reason |
Unique, one-word, CamelCase reason for the condition's last transition. |
conditions[].status |
Status is the status of the condition. Can be True, False, Unknown. |
conditions[].type |
Type is the type of the condition. |
createTime |
Output only. The creation time. |
etag |
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 |
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 |
Output only. The reason(s) why a trigger is in FAILED state. |
transport |
|
transport.pubsub |
|
transport.pubsub.subscription |
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 |
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 |
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"