このページでは、Eventarc で使用可能なアクセス制御オプションについて説明します。
概要
Eventarc は Identity and Access Management(IAM)を使用してアクセスを制御します。
IAM とその機能の概要については、IAM の概要をご覧ください。
許可ポリシーを使用してアクセス権を付与および取り消す方法については、プロジェクト、フォルダ、組織へのアクセスを管理するをご覧ください。
- アクセス ポリシーを使用して Eventarc Advanced でパブリッシュ アクセスを制御するには、パブリッシュ アクセスを制御するをご覧ください。
Eventarc でサポートされる権限とロールについては、以下のセクションをご覧ください。
Eventarc サービス エージェント
一部の Google Cloud サービスには、適切な権限が付与されている場合にサービスがリソースにアクセスできるようにするサービス エージェントがあります。API にサービス エージェントが必要な場合、API を有効にして使用した後、 Google Cloud がサービス エージェントを作成します。
Eventarc では、サービス エージェントを最初に必要になったとき(Eventarc リソースを初めて作成するときなど)にのみ作成するプロビジョニング モデルを使用します。API が最初に有効になったときには作成されません。サービス エージェントのプロビジョニングとシステム全体への変更の反映には数分かかることがあります。この遅延の詳細については、Eventarc サービス エージェントの使用中に権限が拒否されるをご覧ください。
Eventarc API を有効にする
Eventarc の IAM ロールを表示して割り当てるには、プロジェクトで Eventarc API を有効にする必要があります。API を有効にするまで、 Google Cloud コンソールで Eventarc のロールは表示されません。
コンソール
- 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
事前定義ロール
次の表に、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( 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:
|
|
プロジェクト レベルの IAM の管理
プロジェクト レベルでは、 Google Cloud コンソール、IAM API、Google Cloud CLI を使用して IAM ロールの付与、変更、取り消しを行うことができます。手順については、プロジェクト、フォルダ、組織へのアクセスを管理するをご覧ください。