Mengelola akses ke template runtime

Halaman ini menjelaskan cara memberikan dan mencabut akses ke template runtime di Colab Enterprise.

Sebelum memulai

  1. Login ke akun Google Cloud Anda. Jika Anda baru menggunakan Google Cloud, buat akun untuk mengevaluasi performa produk kami dalam skenario dunia nyata. Pelanggan baru juga mendapatkan kredit gratis senilai $300 untuk menjalankan, menguji, dan men-deploy workload.
  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 role (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 Vertex AI, Dataform, and Compute Engine APIs.

    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 APIs

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

    Go to project selector

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

  7. Enable the Vertex AI, Dataform, and Compute Engine APIs.

    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 APIs

Peran yang diperlukan

Untuk mendapatkan izin yang diperlukan guna mengelola akses ke template runtime, minta administrator untuk memberi Anda peran IAM Colab Enterprise Admin (roles/aiplatform.colabEnterpriseAdmin) di project itu. Untuk mengetahui informasi selengkapnya tentang cara memberikan peran, lihat Mengelola akses ke project, folder, dan organisasi.

Anda mungkin juga bisa mendapatkan izin yang diperlukan melalui peran khusus atau peran bawaan lainnya.

Memberikan akses ke template runtime

Untuk memberikan akses utama ke template runtime, Anda dapat menggunakan konsol Google Cloud , Google Cloud CLI, atau Terraform.

Konsol

  1. Di konsol Google Cloud , buka halaman Runtime templates Colab Enterprise.

    Buka Template Runtime

  2. Di menu Region, pilih region yang berisi template runtime Anda.

  3. Di menu Runtime template, pilih template runtime. Jika tidak ada template runtime yang tercantum, buat template runtime terlebih dahulu.

  4. Klik  Izin.

  5. Di jendela Permissions, klik  Add principal.

  6. Dalam dialog Berikan akses, di kolom Akun utama baru, masukkan satu atau daftar akun utama yang dipisahkan koma.

  7. Di menu Pilih peran, lengkapi dialog untuk menetapkan peran.

  8. Opsional: Klik  Tambahkan peran lain, lalu ulangi langkah terakhir.

  9. Klik Simpan.

gcloud

Sebelum menggunakan salah satu data perintah di bawah, lakukan penggantian berikut:

  • RUNTIME_TEMPLATE_ID: ID template runtime Anda.
  • PRINCIPAL: akun utama yang akan ditambahkan binding-nya.
  • ROLE: nama peran yang akan ditetapkan ke akun utama.
  • PROJECT_ID: project ID Anda.
  • REGION: region tempat template runtime Anda berada.

Jalankan perintah berikut:

Linux, macOS, atau Cloud Shell

gcloud colab runtime-templates add-iam-policy-binding RUNTIME_TEMPLATE_ID \
    --member=PRINCIPAL \
    --role=ROLE \
    --project=PROJECT_ID \
    --region=REGION

Windows (PowerShell)

gcloud colab runtime-templates add-iam-policy-binding RUNTIME_TEMPLATE_ID `
    --member=PRINCIPAL `
    --role=ROLE `
    --project=PROJECT_ID `
    --region=REGION

Windows (cmd.exe)

gcloud colab runtime-templates add-iam-policy-binding RUNTIME_TEMPLATE_ID ^
    --member=PRINCIPAL ^
    --role=ROLE ^
    --project=PROJECT_ID ^
    --region=REGION

Untuk mengetahui informasi selengkapnya tentang cara mengelola kebijakan IAM untuk template runtime dari command line, lihat dokumentasi gcloud CLI.

Terraform

Untuk mempelajari cara menerapkan atau menghapus konfigurasi Terraform, lihat Perintah dasar Terraform. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi penyedia Terraform.

Contoh berikut menggunakan resource Terraform google_colab_runtime_template_iam_policy untuk memberikan akses ke template runtime Colab Enterprise.

data "google_iam_policy" "admin" {
  binding {
    role = "roles/viewer"
    members = [
      "user:jane@example.com",
    ]
  }
}

resource "google_colab_runtime_template_iam_policy" "policy" {
  project = google_colab_runtime_template.runtime-template.project
  location = google_colab_runtime_template.runtime-template.location
  runtime_template = google_colab_runtime_template.runtime-template.name
  policy_data = data.google_iam_policy.admin.policy_data
}

Kepala sekolah Colab Enterprise adalah pengguna, grup, atau domain

Anda dapat memberikan akses kepada pengguna, grup, atau domain. Lihat tabel berikut:

Utama Contoh akun pengguna
Satu pengguna user@gmail.com
Grup Google admins@googlegroups.com
Domain Google Workspace example.com

Mencabut akses ke template runtime

Untuk mencabut akses ke template runtime, Anda dapat menggunakan konsol Google Cloud atau gcloud CLI.

Konsol

  1. Di konsol Google Cloud , buka halaman IAM.

    Buka IAM

  2. Pilih project, folder, atau organisasi.

  3. Cari baris yang berisi akun utama yang aksesnya ingin Anda cabut. Kemudian klik Edit akun utama di baris tersebut.

  4. Klik tombol Hapus untuk peran yang ingin Anda cabut, lalu klik Simpan.

gcloud

Sebelum menggunakan salah satu data perintah di bawah, lakukan penggantian berikut:

  • RUNTIME_TEMPLATE_ID: ID template runtime Anda.
  • PRINCIPAL: akun utama yang aksesnya ingin Anda cabut.
  • ROLE: peran yang akan dihapus dari akun utama.
  • PROJECT_ID: project ID Anda.
  • REGION: region tempat template runtime Anda berada.

Jalankan perintah berikut:

Linux, macOS, atau Cloud Shell

gcloud colab runtime-templates remove-iam-policy-binding RUNTIME_TEMPLATE_ID \
    --member=PRINCIPAL \
    --role=ROLE \
    --project=PROJECT_ID \
    --region=REGION

Windows (PowerShell)

gcloud colab runtime-templates remove-iam-policy-binding RUNTIME_TEMPLATE_ID `
    --member=PRINCIPAL `
    --role=ROLE `
    --project=PROJECT_ID `
    --region=REGION

Windows (cmd.exe)

gcloud colab runtime-templates remove-iam-policy-binding RUNTIME_TEMPLATE_ID ^
    --member=PRINCIPAL ^
    --role=ROLE ^
    --project=PROJECT_ID ^
    --region=REGION

Untuk mengetahui informasi selengkapnya tentang cara mengelola kebijakan IAM untuk template runtime dari command line, lihat dokumentasi gcloud CLI.

Langkah berikutnya