Questa pagina descrive le opzioni di controllo dell'accesso disponibili in Eventarc.
Panoramica
Eventarc utilizza Identity and Access Management (IAM) per controllo dell'accesso.
Per un'introduzione a IAM e alle sue funzionalità, consulta la panoramica di IAM.
Per scoprire come concedere e revocare l'accesso utilizzando le policy di autorizzazione, consulta Gestire l'accesso a progetti, cartelle e organizzazioni.
- Per controllare l'accesso alla pubblicazione in Eventarc Advanced utilizzando i criteri di accesso, consulta Controllare l'accesso alla pubblicazione.
Per gli elenchi delle autorizzazioni e dei ruoli supportati da Eventarc, consulta le sezioni seguenti.
Eventarc service agent
Alcuni servizi Google Cloud hanno service agent che consentono al servizio di accedere alle tue risorse se vengono concesse le autorizzazioni appropriate. Se un'API richiede un service agent, Google Cloud lo crea in un momento successivo all'attivazione e all'utilizzo dell'API.
Eventarc utilizza un modello di provisioning che crea il proprio service agent solo quando è necessario, ad esempio quando crei una risorsa Eventarc per la prima volta, e non quando l'API viene inizialmente abilitata. Il provisioning del service agent e la propagazione delle modifiche nel sistema possono richiedere diversi minuti. Per saperne di più su questo ritardo, consulta Autorizzazione negata durante l'utilizzo del service agent Eventarc.
Abilita le API Eventarc
Per visualizzare e assegnare ruoli IAM per Eventarc, devi abilitare le API Eventarc per il tuo progetto. Non potrai visualizzare i ruoli Eventarc nella console Google Cloud finché non abiliti le API.
Console
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Eventarc and Eventarc Publishing APIs.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles. -
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Eventarc and Eventarc Publishing APIs.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.
gcloud
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
Install the Google Cloud CLI.
-
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
-
To initialize the gcloud CLI, run the following command:
gcloud init -
Create or select a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Create a Google Cloud project:
gcloud projects create PROJECT_ID
Replace
PROJECT_IDwith a name for the Google Cloud project you are creating. -
Select the Google Cloud project that you created:
gcloud config set project PROJECT_ID
Replace
PROJECT_IDwith your Google Cloud project name.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Eventarc and Eventarc Publishing APIs:
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.gcloud services enable eventarc.googleapis.com
eventarcpublishing.googleapis.com -
Install the Google Cloud CLI.
-
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
-
To initialize the gcloud CLI, run the following command:
gcloud init -
Create or select a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Create a Google Cloud project:
gcloud projects create PROJECT_ID
Replace
PROJECT_IDwith a name for the Google Cloud project you are creating. -
Select the Google Cloud project that you created:
gcloud config set project PROJECT_ID
Replace
PROJECT_IDwith your Google Cloud project name.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Eventarc and Eventarc Publishing APIs:
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.gcloud services enable eventarc.googleapis.com
eventarcpublishing.googleapis.com
Ruoli predefiniti
La tabella seguente elenca i ruoli IAM predefiniti di Eventarc con un elenco corrispondente di tutte le autorizzazioni incluse in ogni ruolo.
I ruoli predefiniti coprono la maggior parte dei casi d'uso tipici. Se il tuo caso d'uso non è coperto dai ruoli predefiniti, puoi creare un ruolo personalizzato IAM.
Ruoli Eventarc
| Role | Permissions |
|---|---|
Eventarc Admin( Full control over all Eventarc resources. Lowest-level resources where you can grant this role:
|
|
Eventarc Connection Publisher Beta( Can publish events to Eventarc channel connections. Lowest-level resources where you can grant this role:
|
|
Eventarc Developer( Access to read and write Eventarc resources. Lowest-level resources where you can grant this role:
|
|
Eventarc Event Receiver( Can receive events from all event providers. Lowest-level resources where you can grant this role:
|
|
Eventarc Message Bus Admin( Full control over Message Buses resources. |
|
Eventarc Message Bus User( Access to publish to or bind to a Message Bus. |
|
Eventarc Event Collector Beta( Can collect events from multiple projects in an org for a source resource. |
|
Eventarc Publisher Beta( Can publish events to Eventarc channels. Lowest-level resources where you can grant this role:
|
|
Eventarc Service Agent( Gives Eventarc service account access to managed resources. |
|
Eventarc Viewer( Can view the state of all Eventarc resources, including IAM policies. Lowest-level resources where you can grant this role:
|
|
Gestione IAM a livello di progetto
A livello di progetto, puoi concedere, modificare e revocare i ruoli IAM utilizzando la console Google Cloud , l'API IAM o Google Cloud CLI. Per istruzioni, vedi Gestisci l'accesso a progetti, cartelle e organizzazioni.