Questa pagina descrive come concedere a un account utente o di servizio l'accesso alle risorse di base di Dataproc Metastore in un progetto. Google Cloud I ruoli descritti in questa pagina forniscono l'accesso per creare un servizio Dataproc Metastore.
A seconda dell'ambito di controllo che vuoi che abbia l'account, gli concedi uno di questi ruoli IAM predefiniti:
roles/metastore.editor
per concedere il controllo completo delle risorse Dataproc Metastoreroles/metastore.admin
per concedere il controllo completo delle risorse Dataproc Metastore, incluso l'aggiornamento delle autorizzazioni IAM.
Per informazioni dettagliate sulle autorizzazioni IAM specifiche fornite da questi ruoli, consulta Ruoli IAM di Dataproc Metastore.
Prima di iniziare
- 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. resourcemanager.projects.get
resourcemanager.projects.getIamPolicy
resourcemanager.projects.setIamPolicy
PROJECT_ID
: l'ID del progetto a cui vuoi attivare l'accesso a Metastore.PRINCIPAL
: Il tipo e l'ID email (indirizzo email) dell'entità.- Per gli account utente: user:EMAIL_ID
- Per i service account: serviceAccount:EMAIL_ID
- Per Google Gruppi: group:EMAIL_ID
METASTORE_ROLE
: uno dei seguenti valori, a seconda del ruolo che vuoi concedere all'entità:roles/metastore.editor
oroles/metastore.admin
. Per informazioni dettagliate sulle autorizzazioni concesse da questi ruoli, consulta Ruoli IAM di Dataproc Metastore.
Ruoli obbligatori
Devi disporre del ruolo IAM di base roles/owner
(Proprietario) nel
progettoGoogle Cloud che stai utilizzando o di un ruolo che concede queste autorizzazioni:
Per ottenere queste autorizzazioni seguendo il principio del privilegio minimo, chiedi all'amministratore di concederti il ruolo roles/resourcemanager.projectIamAdmin
(amministratore IAM progetto).
Come concedere i ruoli di accesso
gcloud
Per utilizzare gcloud CLI, puoi installare e inizializzare Google Cloud CLI oppure utilizzare Cloud Shell.
Esegui il seguente comando add-iam-policy-binding
per concedere un ruolo predefinito Dataproc Metastore a un'entità IAM
(account utente o account di servizio).
gcloud projects add-iam-policy-binding PROJECT_ID \ --member=PRINCIPAL \ --role=METASTORE_ROLE
Sostituisci quanto segue: