このページでは、プロジェクト内の基本的な Dataproc Metastore リソースへのアクセス権を Google Cloud ユーザー アカウントまたはサービス アカウントに付与する方法について説明します。このページで説明するロールを使用すると、Dataproc Metastore サービスを作成するためのアクセス権が提供されます。
アカウントに付与する制御の範囲に応じて、次のいずれかの事前定義 IAM ロールを付与します。
roles/metastore.editorDataproc Metastore に対する完全アクセス権を付与するroles/metastore.adminは、IAM 権限の更新を含め、Dataproc Metastore リソースに対する完全アクセス権を付与します。
これらのロールが提供する特定の IAM 権限の詳細については、Dataproc Metastore IAM ロールをご覧ください。
始める前に
- 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
(
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 Dataproc Metastore API.
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
(
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 Dataproc Metastore API.
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. resourcemanager.projects.getresourcemanager.projects.getIamPolicyresourcemanager.projects.setIamPolicyPROJECT_ID: Metastore へのアクセスを有効にするプロジェクトの ID。PRINCIPAL: プリンシパルのタイプとメール ID(メールアドレス)です。- ユーザー アカウントの場合: user:EMAIL_ID
- サービス アカウントの場合: serviceAccount:EMAIL_ID
- Google グループの場合: group:EMAIL_ID
METASTORE_ROLE: プリンシパルに付与するロールに応じて、roles/metastore.editorまたはroles/metastore.adminのいずれかの値。これらのロールで付与される権限の詳細については、Dataproc Metastore IAM ロールをご覧ください。
必要なロール
使用しているGoogle Cloud プロジェクトに roles/owner(オーナー)IAM 基本ロールか、次の権限を付与するロールが必要です。
最小権限の原則に従ってこれらの権限を取得するには、管理者に roles/resourcemanager.projectIamAdmin(プロジェクト IAM 管理者)ロールの付与を依頼してください。
アクセスのロールを付与する方法
gcloud
gcloud CLI を使用するには、Google Cloud CLI をインストールして初期化するか、Cloud Shell を使用します。
次の add-iam-policy-binding コマンドを実行して、IAM プリンシパル(ユーザー アカウントまたはサービス アカウント)に Dataproc Metastore の事前定義ロールを付与します。
gcloud projects add-iam-policy-binding PROJECT_ID \
--member=PRINCIPAL \
--role=METASTORE_ROLE以下を置き換えます。