このページでは、プロジェクト内の基本的な Dataproc Metastore リソースへのアクセスを Google Cloud ユーザー アカウントまたはサービス アカウントに付与する方法について説明します。このページで説明するロールを使用すると、Dataproc Metastore サービスを作成するためのアクセス権が提供されます。
アカウントに付与する制御の範囲に応じて、次のいずれかの IAM 事前定義ロールを付与します。
roles/metastore.editor
Dataproc 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.create
permission. 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.enable
permission. 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.create
permission. 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.enable
permission. Learn how to grant roles.
必要なロール
使用している Google Cloud プロジェクトに、roles/owner
(オーナー)の基本 IAM ロール、または次の権限を付与するロールが必要です。
resourcemanager.projects.get
resourcemanager.projects.getIamPolicy
resourcemanager.projects.setIamPolicy
最小権限の原則に従ってこれらの権限を取得するには、管理者に 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
以下を置き換えます。
PROJECT_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 ロールをご覧ください。