本頁說明 Eventarc 提供的存取權控管選項。
總覽
Eventarc 使用 Identity and Access Management (IAM) 控管存取權。
如要瞭解 IAM 及其功能,請參閱 IAM 總覽。如要瞭解如何授予及撤銷存取權,請參閱「管理專案、資料夾和機構的存取權」一文。
如需 Eventarc 支援的權限與角色清單,請參閱下列各節。
Eventarc 服務代理
部分 Google Cloud 服務有服務代理,只要授予適當權限,服務就能存取您的資源。如果 API 需要服務代理程式,則 Google Cloud 會在您啟用及使用 API 後的某個時間點建立服務代理程式。
Eventarc 採用佈建模型,只會在首次需要時建立服務代理程式 (例如首次建立 Eventarc 資源時),而不是在首次啟用 API 時。佈建服務代理並透過系統傳播變更可能需要幾分鐘的時間。如要進一步瞭解這項延遲,請參閱「使用 Eventarc 服務代理程式時遭拒絕權限」。
啟用 Eventarc API
如要查看及指派 Eventarc 的 IAM 角色,您必須為專案啟用 Eventarc API。您必須先啟用 API,才能在 Google Cloud 控制台中看到 Eventarc 角色。
啟用 Eventarc API 和 Eventarc Publishing API:
主控台
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM
role (roles/serviceusage.serviceUsageAdmin
), which
contains the serviceusage.services.enable
permission. Learn how to grant
roles.
gcloud
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM
role (roles/serviceusage.serviceUsageAdmin
), which contains the
serviceusage.services.enable
permission. Learn how to grant
roles.
gcloud services enable eventarc.googleapis.comeventarcpublishing.googleapis.com
預先定義的角色
下表列出 Eventarc 預先定義的 IAM 角色,以及各角色具備的所有權限對應清單。
預先定義的角色可因應許多一般用途。如果預先定義的角色無法滿足您的用途,可以建立 IAM 自訂角色。
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 Beta( Full control over Message Buses resources. |
|
Eventarc Message Bus User Beta( 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:
|
|
專案層級的 IAM 管理
在專案層級中,您可以透過 Google Cloud 控制台、IAM API 或是 Google Cloud CLI 來授予、變更及撤銷 IAM 角色。如需相關操作說明,請參閱「管理專案、資料夾和機構的存取權」。