
EventarcAuthorCloudBrum editorial teamLast reviewedReading time~12 minLevelBeginner to advanced
Google Cloud · App modernization · Event routing with Standard and Advanced
Eventarc is how Google Cloud calls your code when something happens in a project. A file lands in a bucket, someone creates a VM, a message is published, and a trigger delivers the event to Cloud Run, a function, GKE or a workflow, always in the CloudEvents format. It comes in two editions: Standard, with triggers for Google Cloud and Pub/Sub events, and Advanced, with a message bus for your own events plus enrollments and pipelines. Pub/Sub carries Standard’s events underneath, so retries, dead-letter topics and part of the bill come from there.
On this page (17 sections)
Mind map: Eventarc at a glance
Free to share. The downloaded image includes the CloudBrum link.
Key features (summary)
- Events from Google CloudDirect events come from services such as Cloud Storage, and audit log events cover calls to services that don’t send direct events. A trigger names the type and the details you care about.
- Pub/Sub messages as eventsAny system that can publish to Pub/Sub can become an event source, and the trigger wraps the message in a CloudEvent for the destination.
- Destinations that fit serverlessCloud Run services and functions, GKE services, Workflows and internal HTTP endpoints receive events over HTTP, with Google-signed identity.
- One event formatEverything arrives as a CloudEvent, with the attributes in ce- headers. A handler written for one source understands the others.
- A message bus (Advanced)Publish your own events to a regional bus, and let many teams subscribe. A bus can also receive events from Google Cloud sources.
- Enrollments and CELAn enrollment subscribes a pipeline to a bus with a CEL condition over the message, so each consumer gets only its share.
- Pipelines that reshape messagesA pipeline can transform a message with a template and convert between JSON, Avro and Protobuf before it delivers to one destination.
- Retries from Pub/SubStandard triggers use Pub/Sub underneath, so redelivery, backoff and a dead-letter topic work the way they do on any Pub/Sub subscription.
Basic concepts
- Event
- A record that something happened, in the CloudEvents format: attributes such as id, source, type and subject, plus a data payload.
- Trigger (Standard)
- A named rule that says which events to take, from which source, and where to deliver them. It has a location, a destination and a service account.
- Direct event
- An event a Google Cloud service publishes itself, such as google.cloud.storage.object.v1.finalized when a new object is stored.
- Audit log event
- An event made from a Cloud Audit Logs entry, with the type google.cloud.audit.log.v1.written. Data Access logs must be on for services that don’t log those calls by default.
- Transport topic
- The Pub/Sub topic that carries a Standard trigger’s events. Eventarc creates it and a push subscription for you.
- Message bus (Advanced)
- The regional channel that receives events from your publishers and Google Cloud sources. There is one per project and region.
- Google API source
- The link that lets a bus receive events from Google Cloud services in the project.
- Enrollment
- A subscription to a bus. A CEL condition selects the messages, and the matching ones go to a pipeline.
- Pipeline
- The delivery step: an optional transformation, then one destination such as an HTTP endpoint, a workflow, a Pub/Sub topic or another bus.
- CEL (Common Expression Language)
- A small expression language used in enrollments and transformations, for example message.type == 'com.example.order.placed'.
- CloudEvents
- A vendor-neutral event specification from the CNCF. In HTTP delivery, the attributes become ce- headers (binary mode) or fields in a JSON body.
- Trigger service account
- The identity that Eventarc uses to receive events and to call the destination. It needs the event receiver role and permission to invoke the target.
- Dead-letter topic
- A Pub/Sub topic that receives messages a subscription could not deliver after the allowed attempts. It is set on the subscription.
How to create & configure it
Trigger a Cloud Run service from a bucket with gcloud
- Pick the editionStandard fits events from Google Cloud and Pub/Sub into one destination each. Advanced fits your own events, many subscribers and transformations. You can use both in one project.
- Enable the APIsTurn on Eventarc, Cloud Run and Pub/Sub, and the Eventarc publishing API if you plan to use a bus.
- Create a service account for triggersGive it the event receiver role. Use one per application, not the default Compute Engine account.
- Deploy a private receiving serviceKeep the Cloud Run service closed to the public, and allow only the trigger’s identity to invoke it.
- Create the triggerName the event type and the bucket, point it at the service, and pass the service account. The trigger’s location has to match the bucket’s location.
- Add a dead-letter topic on the transport subscriptionEventarc creates a Pub/Sub subscription for the trigger. Set a dead-letter topic and a retry window there, so a failing handler doesn’t lose events.
- Test with a real eventUpload a file and read the service’s log. Check that the handler answers with a 2xx quickly, since anything else means a retry.
- Add an Advanced bus for your own eventsCreate the bus, a pipeline to the service, and an enrollment with a CEL condition. Publish a test message.
- Watch the subscription and the serviceUndelivered message counts and the oldest message age on the transport subscription show trouble before anyone complains.
Tip: a Cloud Storage trigger needs the Cloud Storage service agent to be allowed to publish to Pub/Sub. If trigger creation fails with a permission message, grant that role first. See the code references for the same setup as Terraform.
Common issues after configuration
| Symptom | Likely cause | What to check / fix |
|---|---|---|
| Creating the trigger fails with a permission error | An API isn’t enabled, the caller lacks Eventarc permissions, or the Cloud Storage service agent can’t publish to Pub/Sub | Enable Eventarc, Cloud Run and Pub/Sub, grant the event receiver role to the trigger’s service account, and give the Cloud Storage service agent the Pub/Sub Publisher role. |
| Trigger creation for a bucket is rejected | The trigger’s location doesn’t match the bucket’s location | Create the trigger in the bucket’s region, or in the matching multi-region for a multi-region bucket. |
| An audit log trigger never fires | Data Access audit logs are off for that service, or the service name or method name is wrong | Turn on the needed audit log types, and copy the exact serviceName and methodName from a real log entry. |
| The service answers 403 or the logs show no request | The trigger’s service account can’t invoke the Cloud Run service, or ingress settings block the call | Grant roles/run.invoker to that account on the service, and check the ingress setting. |
| The same event arrives again and again | The handler returned a non-2xx answer or took too long, so Pub/Sub redelivers | Return 2xx fast and do long work afterwards. Make the handler idempotent with the event id. |
| Events stop arriving but the trigger looks fine | A filter is wrong, the transport subscription is backed up, or the destination service is failing or scaled to a limit | Compare the filters with a real event, look at the subscription’s backlog and oldest message age, and read the service’s errors. |
| Events are lost after repeated failures | No dead-letter topic is set on the transport subscription, so messages are dropped when the retry window ends | Add a dead-letter topic on the subscription, give the Pub/Sub service agent the needed roles, and alert on the topic. |
| The handler can’t parse the request | It expects structured JSON but Eventarc sent binary mode with ce- headers, or the other way round | Parse with a CloudEvents library that handles both, and read the type from the header or the body field. |
| An Advanced enrollment matches nothing | The CEL condition doesn’t match the message attributes, or the bus and the pipeline sit in different locations | Print a real message, test the expression on it, and create the pipeline in the bus’s location. Changes can take a couple of minutes. |
| Publishing to a bus is refused | A required CloudEvents attribute is missing, the Eventarc publishing API is off, or the caller lacks the publishing permission | Send id, source, type and specversion, enable the publishing API, and grant the role on the bus. |
| The bill is higher than expected | Chatty audit log events, retries, or many messages through a bus and pipelines, plus Pub/Sub and Cloud Run charges | Narrow filters to the exact method or object prefix, fix failing handlers, and compare Eventarc, Pub/Sub and Cloud Run lines on the invoice. |
Use cases: when and where to use it
Good fit
- Reacting to Google Cloud events, such as a new object or a created VM, without polling
- Cloud Run and Cloud Run functions that should wake on events in CloudEvents form
- Workflows that start when something happens in the project
- Platform teams that want one bus for their own events with several subscribers (Advanced)
- Adapting message formats between producers and consumers with transformations
- Teams that already use Pub/Sub and want standard event envelopes on top
Consider something else
- A durable message queue or stream with many subscribers and replay → Pub/Sub
- Scheduled jobs → Cloud Scheduler, which can call a service or publish to Pub/Sub
- Long, multi-step processes with retries and waits → Workflows, which Eventarc can start
- Per-task delivery with rate limits and deduplication → Cloud Tasks
- The same job on other clouds → compare Amazon EventBridge and Azure Event Grid
Pros: why consider it?
Why teams choose it
- Events from Google Cloud services without writing publishers
- CloudEvents everywhere, so handlers stay portable
- Works with Cloud Run, functions, GKE and Workflows
- Advanced adds a bus, CEL filtering and transformations for your own events
- Retries and dead-lettering through Pub/Sub
- Pay per event or message, with a free monthly allowance on Standard
Trade-offs to weigh
- Two editions with different resources, regions and prices
- Standard’s reliability settings live on a Pub/Sub subscription, not on the trigger
- At-least-once delivery without ordering
- Triggers are regional and must match the event source’s location
- No built-in archive or replay of past events
- Debugging spans Eventarc, Pub/Sub, audit logs and the destination
Common threats, vulnerabilities & risks
| Risk | Severity | Why it matters | Mitigation |
|---|---|---|---|
| No dead-letter topic on the transport subscription | High | When retries end, the event is dropped and nobody is told. | Set a dead-letter topic, and alert on its message count. |
| A public receiving service | High | A Cloud Run service open to everyone can be called by anyone, not only by Eventarc. | Require authentication, and allow only the trigger’s service account to invoke it. |
| Default service accounts on triggers | Medium | The default Compute Engine account is broad, so a bug or a compromise reaches far. | Create a service account per application with only the receiver and invoker roles. |
| Handlers that aren’t idempotent | Medium | A redelivered event repeats whatever the service did the first time, from a second write to a second message. | Keep the event id or a business key and skip repeats. |
| Audit log triggers that match too much | Medium | A broad filter on a busy service creates a flood of events and costs. | Filter on exact service name, method name and resource. |
| Sensitive data in event payloads | Medium | Events pass through Pub/Sub, logs and handlers, each with its own access rules. | Send identifiers, not personal data, and read the record in the handler. |
| Location mismatches | Low–Med | A trigger in the wrong location can’t be created, or silently misses events. | Match the trigger location to the source, and document it in your templates. |
| Unowned triggers and buses | Low–Med | Old triggers keep calling services that were meant to be retired. | Use labels for owner and application, and review triggers every quarter. |
| Relying on order | Low–Med | Events can arrive out of order. | Carry a version or timestamp and ignore stale events. |
Performance optimisation
- Return a 2xx answer quickly and do long work afterwards, because slow handlers cause redelivery.
- Keep events small: send an object name or an ID, not a copy of the data.
- Set minimum instances on Cloud Run for latency-sensitive handlers, or accept the cold start.
- Filter in the trigger or the CEL condition, so the handler isn’t invoked for events it ignores.
- Use regional triggers in the same region as the source and the destination to cut latency and egress.
- Let Pub/Sub absorb bursts: check the subscription’s backlog before you scale the handler.
- Use pipelines to adjust message shape once, instead of every consumer repeating the work.
- Treat delivery as at least once, and design handlers for duplicates and for events out of order.
Reduce monthly cost
FinOps is the habit of managing cloud spend together with engineering. These are the FinOps checks that matter most for Eventarc.
- Remember the free monthly allowance of 50,000 chargeable events on Standard, and that events from Google and Pub/Sub sources aren’t charged by Eventarc itself.
- Add the Pub/Sub transport to your estimate, since Standard bills it on its own.
- Narrow audit log filters to one method and resource, because each matching log entry is an event.
- Fix failing handlers: retries multiply requests, transport traffic and Cloud Run time.
- On Advanced, count bus publishes, pipeline messages and transformations separately, and avoid chains of buses and pipelines.
- Publish fewer, smaller messages, and batch or sample chatty producers.
- Delete unused triggers, buses and pipelines, and their transport subscriptions.
- Keep Cloud Logging volume in check, since verbose handler logs can cost more than the events themselves.
- Don’t use Advanced when a single Standard trigger does the job.
- Label triggers and buses with the owning team, and put a budget alert on Eventarc and Pub/Sub spend.
Rates here come from Google's pricing page and other published guides, read in October 2026. Advanced rates were described as applying from general availability in one localized page, so confirm on the live page (see Pricing).
Security optimisation
- Give each trigger its own service account with the event receiver role and the invoker role on one service.
- Keep receiving services private, and require authentication on every call.
- Grant IAM roles at the narrowest scope, and review who can create or edit triggers, buses and pipelines.
- Use customer-managed encryption keys on buses and pipelines when policy requires them.
- Use VPC Service Controls around Eventarc, Pub/Sub and the destination for sensitive projects.
- Keep personal data and secrets out of event payloads and subjects.
- Use Pub/Sub dead-letter topics with restricted access, since they hold copies of the events that failed.
- Turn on audit logs for Eventarc itself, and alert on changes to triggers and IAM.
- Use an Organization Policy to limit where resources can be created, so triggers stay in approved locations.
- For internal HTTP destinations, use a network attachment and keep the path private.
Governance & compliance
Guardrails
- A Terraform module for a trigger, its service account, the invoker binding and a transport subscription with a dead-letter topic
- An organisation policy for resource locations, so triggers and buses stay in approved regions
- A rule that triggers use their own service account, never the default Compute Engine account
- Labels for owner and application on every trigger, bus and pipeline, checked at creation
Continuous checks (Cloud Asset Inventory and Security Command Center)
- Cloud Asset Inventory queries for triggers that use the default Compute Engine service account (the C# tab does this)
- A query for storage triggers that have no bucket filter
- Alerts on the dead-letter topic and on the oldest unacknowledged message age
- Security Command Center findings for broad IAM roles on the trigger’s service accounts
- A report of triggers and enrollments with no matching events in 90 days
Cloud Audit Logs record who changed triggers and buses, Cloud Asset Inventory answers questions about configuration, Security Command Center reports on risky settings, and Google’s published compliance reports hold audit material. Google runs the service and keeps messages safe in transit and at rest. Event design, who may publish and consume, retry and dead-letter settings, and the handler’s own security are yours.
Reduce carbon footprint
- Trim event volume at the source: batch or sample producers that are chatty.
- Use exact filters so handlers aren’t invoked for events they discard.
- Fix failing handlers, since every retry repeats work and traffic.
- Delete unused triggers, buses, pipelines and their subscriptions.
- Where residency rules and latency allow, use a region with a lower grid carbon intensity. Google publishes carbon data for its regions.
- Google’s carbon footprint report works by project and service and may not list Eventarc on its own, so quote no Eventarc figure.
Pricing
Purchase options
Standard triggers First 50,000 events a month free
Events from Google Cloud sources and from Pub/Sub carry no Eventarc charge per million, as we read the page. Other sources are listed at about $1 per million, with a preview note.
Pub/Sub transport Billed as Pub/Sub
Standard’s events travel through Pub/Sub, so message delivery is charged at Pub/Sub rates on top of Eventarc.
Advanced bus and pipelines About $1.00 and $0.50 per million
Messages published to a bus are listed at about $1.00 per million, and messages sent to a pipeline at about $0.50 per million. Transformations are listed at about $0.40 per million operations.
Things around it Run, logs and storage
Cloud Run requests and CPU, Workflows steps, Cloud Logging and any storage you use are billed by their own services.
What you actually pay for
- Standard events above the monthly free allowance, for sources other than Google and Pub/Sub
- Pub/Sub message delivery for the transport topic and subscription
- Advanced bus publishes, pipeline messages and transformation operations
- Cloud Run, Workflows or GKE resources that handle the events
- Cloud Logging for handler and audit log volume
Rates change and apply by edition. See the official Eventarc pricing page and the Google Cloud Pricing Calculator.
Important code references
File uploads and order events: a private Cloud Run service, a trigger for new files in one bucket and one for new VMs from an audit log, then an Advanced bus, pipeline and enrollment for your own order events. The gcloud tab builds it and publishes a test event; Terraform describes the same resources. The Python tab is the receiving service, with Flask and the CloudEvents library, and the C# tab audits a project’s Standard triggers for default service accounts, unfiltered storage triggers and unhealthy conditions. Replace the project, region and bucket with your own, and try it in a scratch project first.
# Placeholders: replace the project, region and bucket with your own. The hello image is only a stand-in for your service.
PROJECT=my-project
REGION=asia-south1
BUCKET=my-project-uploads
SVC=upload-handler
SA=eventarc-invoker
SA_EMAIL=$SA@$PROJECT.iam.gserviceaccount.com
gcloud config set project $PROJECT
# 1. Turn on the APIs the setup uses.
gcloud services enable eventarc.googleapis.com run.googleapis.com pubsub.googleapis.com eventarcpublishing.googleapis.com
# 2. A service account of its own for the triggers. It may receive events and may call the Cloud Run service.
gcloud iam service-accounts create $SA --display-name "Eventarc trigger identity"
gcloud projects add-iam-policy-binding $PROJECT --member serviceAccount:$SA_EMAIL --role roles/eventarc.eventReceiver
# 3. The receiving service. It stays private: only the trigger's identity may call it.
gcloud run deploy $SVC --region $REGION --image us-docker.pkg.dev/cloudrun/container/hello --no-allow-unauthenticated
gcloud run services add-iam-policy-binding $SVC --region $REGION --member serviceAccount:$SA_EMAIL --role roles/run.invoker
# 4. Eventarc Standard: a trigger for new files in one bucket. The type is required, and so is the bucket for this type.
gcloud eventarc triggers create uploads-trigger --location $REGION \
--event-filters type=google.cloud.storage.object.v1.finalized --event-filters bucket=$BUCKET \
--destination-run-service $SVC --destination-run-region $REGION --service-account $SA_EMAIL
# 5. A second trigger from an audit log: tell the service whenever someone creates a VM. Data Access audit logs must be on for this service.
gcloud eventarc triggers create vm-created-trigger --location $REGION \
--event-filters type=google.cloud.audit.log.v1.written --event-filters serviceName=compute.googleapis.com \
--event-filters methodName=v1.compute.instances.insert \
--destination-run-service $SVC --destination-run-region $REGION --service-account $SA_EMAIL
# 6. Check the triggers, then drop a file in the bucket and read the service's log.
gcloud eventarc triggers list --location $REGION
echo hello > hello.txt && gcloud storage cp hello.txt gs://$BUCKET/hello.txt
gcloud run services logs read $SVC --region $REGION --limit 20
# 7. Eventarc Advanced: a message bus for your own events, a pipeline to the service and an enrollment that picks the events.
URL=$(gcloud run services describe $SVC --region $REGION --format 'value(status.url)')
gcloud eventarc message-buses create orders-bus --location $REGION
gcloud eventarc pipelines create orders-to-service --location $REGION \
--destinations=http_endpoint_uri=$URL,google_oidc_authentication_service_account=$SA_EMAIL
gcloud eventarc enrollments create order-placed --location $REGION --message-bus orders-bus \
--cel-match "message.type == 'com.example.order.placed'" --destination-pipeline orders-to-service
# 8. Publish one event to the bus.
gcloud eventarc message-buses publish orders-bus --location $REGION --event-id A-1001 --event-type com.example.order.placed \
--event-source //shop/orders --event-data '{"orderId": "A-1001", "total": 2500}'
gcloud run services logs read $SVC --region $REGION --limit 5
# Placeholders: pass in your own project and bucket name. The hello image stands in for your service.
variable "project_id" {
type = string
}
variable "region" {
type = string
default = "asia-south1"
}
variable "bucket_name" {
type = string
}
provider "google" {
project = var.project_id
region = var.region
}
resource "google_project_service" "apis" {
for_each = toset([
"eventarc.googleapis.com", "run.googleapis.com", "pubsub.googleapis.com", "eventarcpublishing.googleapis.com",
])
service = each.value
disable_on_destroy = false
}
resource "google_service_account" "trigger" {
account_id = "eventarc-invoker"
display_name = "Eventarc trigger identity"
}
resource "google_project_iam_member" "receiver" {
project = var.project_id
role = "roles/eventarc.eventReceiver"
member = "serviceAccount:${google_service_account.trigger.email}"
}
resource "google_cloud_run_v2_service" "handler" {
name = "upload-handler"
location = var.region
ingress = "INGRESS_TRAFFIC_ALL"
template {
containers {
image = "us-docker.pkg.dev/cloudrun/container/hello"
}
}
depends_on = [google_project_service.apis]
}
# Only the trigger's identity may call the service.
resource "google_cloud_run_v2_service_iam_member" "invoker" {
name = google_cloud_run_v2_service.handler.name
location = var.region
role = "roles/run.invoker"
member = "serviceAccount:${google_service_account.trigger.email}"
}
resource "google_storage_bucket" "uploads" {
name = var.bucket_name
location = var.region
uniform_bucket_level_access = true
}
# Storage events travel through Pub/Sub, so the Cloud Storage service agent must be allowed to publish.
data "google_storage_project_service_account" "gcs" {}
resource "google_project_iam_member" "gcs_publisher" {
project = var.project_id
role = "roles/pubsub.publisher"
member = "serviceAccount:${data.google_storage_project_service_account.gcs.email_address}"
}
resource "google_eventarc_trigger" "uploads" {
name = "uploads-trigger"
location = var.region
matching_criteria {
attribute = "type"
value = "google.cloud.storage.object.v1.finalized"
}
matching_criteria {
attribute = "bucket"
value = google_storage_bucket.uploads.name
}
destination {
cloud_run_service {
service = google_cloud_run_v2_service.handler.name
region = var.region
}
}
service_account = google_service_account.trigger.email
depends_on = [google_project_iam_member.receiver, google_project_iam_member.gcs_publisher]
}
# Eventarc Advanced: a bus for your own events, a pipeline to the service, and an enrollment that picks the events.
resource "google_eventarc_message_bus" "orders" {
location = var.region
message_bus_id = "orders-bus"
depends_on = [google_project_service.apis]
}
resource "google_eventarc_pipeline" "orders" {
location = var.region
pipeline_id = "orders-to-service"
destinations {
http_endpoint {
uri = google_cloud_run_v2_service.handler.uri
}
authentication_config {
google_oidc {
service_account = google_service_account.trigger.email
}
}
}
}
resource "google_eventarc_enrollment" "placed" {
enrollment_id = "order-placed"
location = var.region
message_bus = google_eventarc_message_bus.orders.id
cel_match = "message.type == 'com.example.order.placed'"
destination = google_eventarc_pipeline.orders.id
}
output "service_url" {
value = google_cloud_run_v2_service.handler.uri
}
# pip install flask "cloudevents<2" gunicorn
# A Cloud Run service that receives events from Eventarc and reacts to three kinds of them.
# Save as app.py and run it on Cloud Run with: gunicorn --bind :$PORT app:app
# Eventarc posts a CloudEvent as an HTTP request, with the attributes in ce-* headers and the data in the body.
import os
from cloudevents.http import from_http
from flask import Flask, request
app = Flask(__name__)
handled = set() # in memory only; use Firestore or Redis if the same event must never run twice across instances
@app.post("/")
def receive():
event = from_http(request.headers, request.get_data())
if event["id"] in handled: # delivery is at least once, so a repeat is normal
return "", 204
kind, data = event["type"], event.data
if kind == "google.cloud.storage.object.v1.finalized":
print("new object gs://%s/%s (%s bytes)" % (data["bucket"], data["name"], data.get("size", "?")), flush=True)
elif kind == "google.cloud.audit.log.v1.written":
proto = data.get("protoPayload", {})
print("%s called %s on %s" % (proto.get("authenticationInfo", {}).get("principalEmail", "someone"),
proto.get("methodName"), proto.get("resourceName")), flush=True)
elif kind == "com.example.order.placed":
print("order %s for %s" % (data["orderId"], data["total"]), flush=True)
else:
print("ignoring", kind, flush=True) # answer 2xx for what you don't handle, or Pub/Sub keeps redelivering it
handled.add(event["id"])
return "", 204 # any non-2xx answer makes Eventarc retry, so reserve errors for real, temporary failures
if __name__ == "__main__":
app.run(host="0.0.0.0", port=int(os.environ.get("PORT", 8080)))
// dotnet add package Google.Cloud.Eventarc.V1
// Audits the Eventarc Standard triggers of a project in one location: triggers that use the default Compute Engine
// service account, triggers that watch every bucket, and triggers whose conditions report a problem.
using Google.Cloud.Eventarc.V1;
string project = args.Length > 0 ? args[0] : "my-project";
string location = args.Length > 1 ? args[1] : "asia-south1";
int problems = 0;
EventarcClient client = EventarcClient.Create();
foreach (Trigger trigger in client.ListTriggers($"projects/{project}/locations/{location}"))
{
string name = trigger.TriggerName.TriggerId;
if (string.IsNullOrEmpty(trigger.ServiceAccount) || trigger.ServiceAccount.EndsWith("-compute@developer.gserviceaccount.com"))
{
Console.WriteLine($"{name}: uses the default Compute Engine service account, give it its own");
problems++;
}
bool storageEvent = trigger.EventFilters.Any(f => f.Attribute == "type" && f.Value.StartsWith("google.cloud.storage."));
bool namesBucket = trigger.EventFilters.Any(f => f.Attribute == "bucket");
if (storageEvent && !namesBucket)
{
Console.WriteLine($"{name}: storage trigger without a bucket filter");
problems++;
}
foreach (var condition in trigger.Conditions)
{
if (condition.Value.Code != Google.Rpc.Code.Ok)
{
Console.WriteLine($"{name}: {condition.Key} reports {condition.Value.Code}: {condition.Value.Message}");
problems++;
}
}
}
Console.WriteLine(problems == 0 ? "No problems found." : $"{problems} problem(s) found.");
return problems == 0 ? 0 : 1;
Best videos to explore
Videos picked for this service. Each one is labelled with its source, opens on YouTube if you prefer, and loads only when you press play.
Interview questions
BasicWhat is Eventarc?
It’s the Google Cloud service that delivers events to your code. A trigger picks events from a source, such as a Cloud Storage bucket, a Cloud Audit Logs entry or a Pub/Sub topic, and sends them in the CloudEvents format to a destination like Cloud Run, a function, GKE or a workflow.
BasicHow is Eventarc different from Pub/Sub?
Pub/Sub is a messaging service: publishers send messages to topics and subscribers receive them. Eventarc sits on top for events: it knows about Google Cloud sources, turns them into CloudEvents, and wires them to destinations. Standard triggers use Pub/Sub as their transport, and Advanced adds its own bus.
BasicWhat are Standard and Advanced?
Standard creates triggers that route events from Google Cloud sources and Pub/Sub to one destination each. Advanced adds a message bus for your own events, enrollments that select messages with CEL conditions, and pipelines that transform and deliver them. Both use the CloudEvents format.
IntermediateHow do retries and dead-lettering work with Standard triggers?
The trigger’s events travel over a Pub/Sub subscription that Eventarc creates, so retry behaviour is the subscription’s: redelivery with backoff until the retention window ends, which Eventarc sets to 24 hours by default. For Cloud Run destinations you can also choose a single attempt. A dead-letter topic is configured on that subscription, not on the trigger.
IntermediateWhy does an audit log trigger not fire?
Usually because the service doesn’t write the log entry you expect. Admin Activity logs are on by default, but many Data Access logs are off. Check that the right audit log types are enabled, and use the exact serviceName and methodName from a real log entry.
IntermediateHow does a handler receive an event, and how should it answer?
Eventarc sends an HTTP POST with the CloudEvent attributes as ce- headers and the data in the body. The handler should return a 2xx status quickly. Any other status, or a timeout, makes Pub/Sub deliver again, so reserve errors for real, temporary failures and ignore events you don’t handle.
AdvancedHow would you design an event flow for an upload pipeline, from a bucket to several consumers?
A Standard trigger on the bucket sends each new object to one handler. For several consumers, publish the event onto an Advanced bus, or fan out through Pub/Sub, and let each consumer use an enrollment with its own condition. Make handlers idempotent on the object generation, set a dead-letter topic, and alarm on backlog age.
AdvancedHow would you secure an Eventarc setup?
Use a service account per application with the event receiver and invoker roles only, keep Cloud Run services private, use customer-managed keys on buses and pipelines where required, place the projects inside VPC Service Controls for sensitive data, keep personal data out of payloads, and audit triggers with Cloud Asset Inventory.
AdvancedWhen would you use an Advanced pipeline transformation, and what are the limits?
When producers and consumers disagree on shape, for example a legacy consumer that needs flat JSON, or a format change between JSON and Avro. A transformation is a template with CEL functions, and each pipeline has one destination, so several destinations need several enrollments and pipelines. Plan for a delay of a couple of minutes when you change a pipeline.
AdvancedWhat do you check when events are late or missing?
Start with the transport subscription: the number of undelivered messages and the age of the oldest one. Then the handler’s status codes and logs, the trigger filters against a real event, IAM roles for the service account, and the location match between trigger and source. For Advanced, test the CEL expression on a printed message and confirm the bus and pipeline share a region.
Similar or alternative services on other clouds
| Capability | AWS | Azure | Google Cloud |
|---|---|---|---|
| Service | Amazon EventBridge | Azure Event Grid | Eventarc with Pub/Sub |
| Events from the platform | Default bus, AWS service events free | System topics for Azure services | Standard triggers for Google Cloud sources and audit logs |
| Your own events | Custom buses with PutEvents | Custom topics, domains, namespace topics | Advanced message bus, or Pub/Sub |
| Filtering | Event patterns on any field | Event type, subject and advanced filters | Trigger filters, and CEL conditions in Advanced |
| Delivery | Push to targets, five per rule | Push to handlers; pull delivery in namespaces | Push over HTTP, with Pub/Sub as the transport |
| Retry and dead letter | Retry policy and an SQS dead-letter queue | Backoff retries and a Blob Storage dead-letter location | Pub/Sub subscription retry and a dead-letter topic |
| Reshaping messages | Input transformers | Delivery attribute mapping | Pipeline transformations in Advanced |
| Schedules | EventBridge Scheduler | Timer triggers and Logic Apps | Cloud Scheduler |
| How you are billed | Per custom event, Pipes request, archive GB | Per operation; throughput units in namespaces | Per event or message, plus Pub/Sub transport |
Typical destinations include Cloud Run and Cloud Run functions, and a common source is Cloud Storage. Dashboards and alerts for the transport subscription are in Cloud Monitoring.
Did you find this article helpful?
Your answer helps us improve this page for the next reader.
Sources and further reading
CloudBrum wrote this page in its own words, using the provider’s public documentation listed below as the reference. Features, limits, names and prices change, so confirm anything that matters on the provider’s own pages before you decide.
- Eventarc overviewGoogle Cloud
- Eventarc Standard overviewGoogle Cloud
- Eventarc Advanced overviewGoogle Cloud
- Event providers and destinationsGoogle Cloud
- Event format in Eventarc StandardGoogle Cloud
- Retry eventsGoogle Cloud
- Create an enrollment to receive eventsGoogle Cloud
- Eventarc pricingGoogle Cloud
- Eventarc release notesGoogle Cloud
- Terraform google provider: google_eventarc_triggerHashiCorp
