Questa pagina descrive come concedere a un Google Cloud account utente o service account l'accesso alle risorse di base di Dataproc Metastore in un progetto. Questi ruoli descritti in questa pagina forniscono l'accesso per creare un servizio Dataproc Metastore.
A seconda dell'ambito di controllo che vuoi che l'account abbia, concedi uno di questi ruoli IAM predefiniti:
roles/metastore.editorper concedere il controllo completo delle risorse Dataproc Metastoreroles/metastore.adminper 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
- Accedi al tuo Google Cloud account. Se non conosci Google Cloud, crea un account per valutare le prestazioni dei nostri prodotti in scenari reali. I nuovi clienti ricevono anche 300 $di crediti senza costi per l'esecuzione, il test e il deployment dei workload.
-
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 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 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 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.
Ruoli obbligatori
Devi disporre del ruolo IAM di base roles/owner (Proprietario) nel
Google Cloud progetto che stai utilizzando o di un ruolo che conceda queste autorizzazioni:
resourcemanager.projects.getresourcemanager.projects.getIamPolicyresourcemanager.projects.setIamPolicy
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 add-iam-policy-binding comando per concedere un ruolo predefinito di Dataproc Metastore a un'entità IAM
(account utente o account di servizio).
gcloud projects add-iam-policy-binding PROJECT_ID \
--member=PRINCIPAL \
--role=METASTORE_ROLESostituisci quanto segue:
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 i gruppi Google: group:EMAIL_ID
METASTORE_ROLE: uno dei seguenti valori, a seconda del ruolo che vuoi concedere all'entità:roles/metastore.editororoles/metastore.admin. Per informazioni dettagliate sulle autorizzazioni concesse da questi ruoli, consulta Ruoli IAM di Dataproc Metastore.