Configurar un proyecto

En este documento se describe cómo configurar un Google Cloud proyecto y una máquina virtual de Compute Engine.

Configurar un Google Cloud proyecto

  1. 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.
  2. 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 the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. Enable the Google Cloud Dataproc API.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains the serviceusage.services.enable permission. Learn how to grant roles.

    Enable the API

  5. Install the Google Cloud CLI.

  6. Si utilizas un proveedor de identidades (IdP) externo, primero debes iniciar sesión en la CLI de gcloud con tu identidad federada.

  7. Para inicializar gcloud CLI, ejecuta el siguiente comando:

    gcloud init
  8. 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 the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  9. Verify that billing is enabled for your Google Cloud project.

  10. Enable the Google Cloud Dataproc API.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains the serviceusage.services.enable permission. Learn how to grant roles.

    Enable the API

  11. Install the Google Cloud CLI.

  12. Si utilizas un proveedor de identidades (IdP) externo, primero debes iniciar sesión en la CLI de gcloud con tu identidad federada.

  13. Para inicializar gcloud CLI, ejecuta el siguiente comando:

    gcloud init
  14. ¿Necesitas credenciales? Solo necesitas credenciales si tienes previsto llamar directamente a las APIs de Dataproc desde tu aplicación o desde un navegador. Si tienes previsto usar la Google Cloud consola o la CLI de Google Cloud para crear y gestionar clústeres, así como para enviar trabajos, solo tienes que iniciar sesión en el SDK con el comando gcloud init.

    Opcional: Configurar una VM

    Si tienes previsto ejecutar la CLI de gcloud desde una instancia de máquina virtual (VM) de Compute Engine, la VM debe configurarse para acceder a los servicios de Google Cloud .

    Para comprobar si tu máquina virtual está configurada correctamente, ejecuta gcloud compute instances describe YOUR_VM_INSTANCE_NAME desde la línea de comandos. Debe haber una cuenta de servicio que incluya el ámbito https://www.googleapis.com/auth/cloud-platform. Para obtener más información sobre cómo configurar una VM, consulta Crear una VM que use una cuenta de servicio gestionada por el usuario.