Halaman ini menjelaskan opsi kontrol akses yang tersedia untuk Anda di Eventarc.
Ringkasan
Eventarc menggunakan Identity and Access Management (IAM) untuk kontrol akses.
Untuk mengetahui pengantar tentang IAM dan fitur-fiturnya, lihat Ringkasan IAM.
Untuk mempelajari cara memberikan dan mencabut akses menggunakan kebijakan izin, lihat Mengelola akses ke project, folder, dan organisasi.
- Untuk mengontrol akses publikasi di Eventarc Advanced menggunakan kebijakan akses, lihat Mengontrol akses publikasi.
Untuk mengetahui daftar izin dan peran yang didukung Eventarc, lihat bagian berikut.
Agen layanan Eventarc
Beberapa layanan Google Cloud memiliki agen layanan yang memungkinkan layanan mengakses resource Anda jika diberi izin yang sesuai. Jika API memerlukan agen layanan, maka Google Cloud membuat agen layanan pada suatu saat setelah Anda mengaktifkan dan menggunakan API.
Eventarc menggunakan model penyediaan yang membuat agen layanannya hanya saat pertama kali diperlukan—misalnya, saat Anda membuat resource Eventarc untuk pertama kalinya—dan bukan saat API diaktifkan pertama kali. Penyediaan agen layanan dan penerapan perubahan melalui sistem dapat memerlukan waktu beberapa menit. Untuk mengetahui informasi selengkapnya tentang penundaan ini, lihat Izin ditolak saat menggunakan agen layanan Eventarc.
Mengaktifkan Eventarc API
Untuk melihat dan menetapkan peran IAM untuk Eventarc, Anda harus mengaktifkan Eventarc API untuk project Anda. Anda tidak akan dapat melihat peran Eventarc di konsol Google Cloud hingga Anda mengaktifkan API.
Konsol
- 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
Peran yang telah ditetapkan
Tabel berikut mencantumkan peran IAM bawaan Eventarc dengan daftar terkait semua izin yang disertakan dalam setiap peran.
Peran bawaan ini mencakup sebagian besar kasus penggunaan umum. Jika kasus penggunaan Anda tidak tercakup oleh peran standar, Anda dapat membuat peran IAM kustom.
Peran 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:
|
|
Pengelolaan IAM di level project
Di tingkat project, Anda dapat memberikan, mengubah, dan mencabut peran IAM menggunakan konsol Google Cloud , IAM API, atau Google Cloud CLI. Untuk mengetahui petunjuknya, lihat Mengelola akses ke project, folder, dan organisasi.