<br />

Eventarc lets you securely route events from Google Cloud services and
other event providers to various destinations. To manage this access, depending
on the event source and target, grant specific
[Identity and Access Management (IAM) roles](https://docs.cloud.google.com/iam/docs/overview.md.txt) to the
[principal](https://docs.cloud.google.com/iam/docs/principals-overview.md.txt) creating triggers or deploying
workloads, your trigger service account, and Google-managed
[service agents](https://docs.cloud.google.com/iam/docs/service-agents.md.txt). For more information, see the
guide linked in the **Event target** column of the table.

## Required roles by event source and target

When you filter the following table by a specific event source or target, the
results automatically include the applicable **All event sources** and **All
event targets** rows. These baseline roles apply in addition to any
source-specific or target-specific roles.

For example, when you grant roles for Cloud Storage direct events routed to
Cloud Run functions, the roles in the **All event sources** and **All event
targets** rows also apply.
Select an event source Cloud Storage direct events Cloud Pub/Sub direct events Other event sources Select an event target Cloud Run Cloud Run functions GKE Internal HTTP endpoint in a VPC network Workflows <button class="clear-all">Reset selection</button>

| Event source | Principal or service agent | Required role | When required | Event target |
|---|---|---|---|---|
| All event sources source-all source-cloud-storage source-pubsub | Principal invoking Eventarc (for example, the trigger creator) | [Eventarc Admin](https://docs.cloud.google.com/iam/docs/roles-permissions/eventarc.md.txt#eventarc.admin) (`roles/eventarc.admin`) | **Required on the project:** Grants full control over Eventarc resources, including specifying a service account when creating a trigger. | All event targets target-vpc target-cloud-run-functions target-cloud-run-service target-gke target-workflows |
| All event sources source-all source-cloud-storage source-pubsub | Principal invoking Eventarc (for example, the trigger creator) | [Service Account User](https://docs.cloud.google.com/iam/docs/roles-permissions/iam.md.txt#iam.serviceAccountUser) (`roles/iam.serviceAccountUser`) | **Required on the project or service account:** Lets you attach a user-managed service account to a trigger and act as the runtime, build, or workflow service account when deploying targets. | All event targets target-vpc target-cloud-run-functions target-cloud-run-service target-gke target-workflows |
| All event sources source-all source-cloud-storage source-pubsub | Eventarc service agent (`service-PROJECT_NUMBER@gcp-sa-eventarc.iam.gserviceaccount.com`) | [Eventarc Service Agent](https://docs.cloud.google.com/iam/docs/roles-permissions/eventarc.md.txt#eventarc.serviceAgent) (`roles/eventarc.serviceAgent`) | **Granted by default on the project:** Lets the service agent manage underlying transport resources and validate event sources. Granted automatically when you create an Eventarc resource for the first time, but you must restore this role if it is removed. | All event targets target-vpc target-cloud-run-functions target-cloud-run-service target-gke target-workflows |
| All event sources source-all source-cloud-storage | Trigger service account | [Eventarc Event Receiver](https://docs.cloud.google.com/iam/docs/roles-permissions/eventarc.md.txt#eventarc.eventReceiver) (`roles/eventarc.eventReceiver`) | **Required on the project:** Lets the trigger receive events from event providers. Not required for direct events from Cloud Pub/Sub. | All event targets target-vpc target-cloud-run-functions target-cloud-run-service target-gke target-workflows |
| All event sources source-all source-cloud-storage source-pubsub | Cloud Pub/Sub service agent (`service-PROJECT_NUMBER@gcp-sa-pubsub.iam.gserviceaccount.com`) | [Service Account Token Creator](https://docs.cloud.google.com/iam/docs/roles-permissions/iam.md.txt#iam.serviceAccountTokenCreator) (`roles/iam.serviceAccountTokenCreator`) | **Granted by default on the project (conditional):** Lets the service agent create identity tokens for authenticated push requests. You must manually grant this role only if you enabled the Cloud Pub/Sub service agent on or before April 8, 2021. | All event targets target-vpc target-cloud-run-functions target-cloud-run-service target-gke target-workflows |
| Cloud Storage direct events source-cloud-storage | Cloud Storage service agent (`service-PROJECT_NUMBER@gs-project-accounts.iam.gserviceaccount.com`) | [Pub/Sub Publisher](https://docs.cloud.google.com/iam/docs/roles-permissions/pubsub.md.txt#pubsub.publisher) (`roles/pubsub.publisher`) | **Required on the project:** Lets the service agent publish bucket notifications to the underlying transport topic. | All event targets target-vpc target-cloud-run-functions target-cloud-run-service target-gke target-workflows |
| All event sources source-all source-cloud-storage source-pubsub | Trigger service account | [Cloud Run Invoker](https://docs.cloud.google.com/iam/docs/roles-permissions/run.md.txt#run.invoker) (`roles/run.invoker`) | **Required on the Cloud Run service or project (conditional):** Lets the trigger invoke an authenticated Cloud Run target service. | [Cloud Run](https://docs.cloud.google.com/eventarc/docs/roles-permissions.md.txt) target-cloud-run-service |
| All event sources source-all source-cloud-storage source-pubsub | Principal deploying the function | One of the following based on your deployment method: - [Cloud Run Source Developer](https://docs.cloud.google.com/iam/docs/roles-permissions/run.md.txt#run.sourceDeveloper) (`roles/run.sourceDeveloper`) and [Service Usage Consumer](https://docs.cloud.google.com/iam/docs/roles-permissions/serviceusage.md.txt#serviceusage.serviceUsageConsumer) (`roles/serviceusage.serviceUsageConsumer`) - [Cloud Functions Developer](https://docs.cloud.google.com/iam/docs/roles-permissions/cloudfunctions.md.txt#cloudfunctions.developer) (`roles/cloudfunctions.developer`) or [Cloud Functions Admin](https://docs.cloud.google.com/iam/docs/roles-permissions/cloudfunctions.md.txt#cloudfunctions.admin) (`roles/cloudfunctions.admin`) | **Required on the project:** Lets you create and update functions. Grant one of the following based on your deployment method: - `gcloud run deploy` or Cloud Run Admin API: Grant `roles/run.sourceDeveloper` and `roles/serviceusage.serviceUsageConsumer`. - `gcloud functions deploy` or Cloud Functions v2 API: Grant `roles/cloudfunctions.developer` or `roles/cloudfunctions.admin`. | [Cloud Run functions](https://docs.cloud.google.com/eventarc/standard/docs/functions/roles-permissions.md.txt) target-cloud-run-functions |
| All event sources source-all source-cloud-storage source-pubsub | Trigger service account | [Cloud Run Invoker](https://docs.cloud.google.com/iam/docs/roles-permissions/run.md.txt#run.invoker) (`roles/run.invoker`) | **Required on the underlying Cloud Run service or project (conditional):** Lets the trigger invoke an authenticated Cloud Run function. | [Cloud Run functions](https://docs.cloud.google.com/eventarc/standard/docs/functions/roles-permissions.md.txt) target-cloud-run-functions |
| All event sources source-all source-cloud-storage source-pubsub | Cloud Functions service agent (`service-PROJECT_NUMBER@gcf-admin-robot.iam.gserviceaccount.com`) | [Cloud Functions Service Agent](https://docs.cloud.google.com/iam/docs/roles-permissions/cloudfunctions.md.txt#cloudfunctions.serviceAgent) (`roles/cloudfunctions.serviceAgent`) | **Granted by default on the project (conditional):** Required when deploying functions with `gcloud functions deploy` or the Cloud Functions v2 API so that the service agent can create and manage Eventarc triggers and underlying Cloud Run services. Granted automatically when you enable the Cloud Functions API. Note: This role is deprecated and applies only to functions created using the Cloud Functions API. For functions created using Cloud Run, see the [Cloud Run roles and permissions](https://docs.cloud.google.com/iam/docs/roles-permissions/run.md.txt) page. | [Cloud Run functions](https://docs.cloud.google.com/eventarc/standard/docs/functions/roles-permissions.md.txt) target-cloud-run-functions |
| All event sources source-all source-cloud-storage source-pubsub | Trigger service account | [Pub/Sub Subscriber](https://docs.cloud.google.com/iam/docs/roles-permissions/pubsub.md.txt#pubsub.subscriber) (`roles/pubsub.subscriber`) | **Required on the project:** Lets the trigger consume messages from Pub/Sub and attach subscriptions to a topic. | [GKE](https://docs.cloud.google.com/eventarc/standard/docs/gke/roles-permissions.md.txt) target-gke |
| All event sources source-all source-cloud-storage source-pubsub | Trigger service account | [Monitoring Metric Writer](https://docs.cloud.google.com/iam/docs/roles-permissions/monitoring.md.txt#monitoring.metricWriter) (`roles/monitoring.metricWriter`) | **Required on the project:** Lets Eventarc's event forwarder write metrics using Cloud Monitoring and other systems that provide metrics. | [GKE](https://docs.cloud.google.com/eventarc/standard/docs/gke/roles-permissions.md.txt) target-gke |
| All event sources source-all source-cloud-storage source-pubsub | Eventarc service agent (`service-PROJECT_NUMBER@gcp-sa-eventarc.iam.gserviceaccount.com`) | All of the following: - [Compute Viewer](https://docs.cloud.google.com/iam/docs/roles-permissions/compute.md.txt#compute.viewer) (`roles/compute.viewer`) - [Kubernetes Engine Developer](https://docs.cloud.google.com/iam/docs/roles-permissions/container.md.txt#container.developer) (`roles/container.developer`) - [Service Account Admin](https://docs.cloud.google.com/iam/docs/roles-permissions/iam.md.txt#iam.serviceAccountAdmin) (`roles/iam.serviceAccountAdmin`) | **Required on the project:** Lets the service agent create the event forwarder component and manage resources in the GKE cluster. Bound when you run `gcloud eventarc gke-destinations init`. | [GKE](https://docs.cloud.google.com/eventarc/standard/docs/gke/roles-permissions.md.txt) target-gke |
| All event sources source-all source-cloud-storage source-pubsub | Eventarc service agent (`service-PROJECT_NUMBER@gcp-sa-eventarc.iam.gserviceaccount.com`) | [DNS Peer](https://docs.cloud.google.com/iam/docs/roles-permissions/dns.md.txt#dns.peer) (`roles/dns.peer`) | **Required on the VPC host project (conditional):** Lets the trigger project's service agent access target networks with DNS peering zones when the internal HTTP endpoint URI uses an internal DNS name resolvable by Cloud DNS. | [Internal HTTP endpoint in a VPC network](https://docs.cloud.google.com/eventarc/standard/docs/vpc-endpoints/roles-permissions-internal.md.txt) target-vpc |
| All event sources source-all source-cloud-storage source-pubsub | Trigger service account | [Workflows Invoker](https://docs.cloud.google.com/iam/docs/roles-permissions/workflows.md.txt#workflows.invoker) (`roles/workflows.invoker`) | **Required on the project:** Lets the trigger initiate a target workflow execution. | [Workflows](https://docs.cloud.google.com/eventarc/standard/docs/workflows/roles-permissions.md.txt) target-workflows |
| All event sources source-all source-cloud-storage source-pubsub | Workflow service account | [Logs Writer](https://docs.cloud.google.com/iam/docs/roles-permissions/logging.md.txt#logging.logWriter) (`roles/logging.logWriter`) | **Required on the project (conditional):** Required if your workflow sends logs to Cloud Logging. | [Workflows](https://docs.cloud.google.com/eventarc/standard/docs/workflows/roles-permissions.md.txt) target-workflows |

## What's next

- [Support a cross-project service
  account](https://docs.cloud.google.com/eventarc/docs/use-cross-project-service-account)