Mengelola akses ke template runtime

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

Sebelum memulai

  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.

    Go to project selector

  3. Make sure that billing is enabled for your Google Cloud project.

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

    Enable the APIs

  5. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  6. Make sure that billing is enabled for your Google Cloud project.

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

    Enable the APIs

  8. Peran yang diperlukan

    Untuk mendapatkan izin yang diperlukan untuk mengelola akses ke template runtime, minta administrator untuk memberi Anda peran IAM Colab Enterprise Admin (roles/aiplatform.colabEnterpriseAdmin) di project. 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 Izin, klik  Tambahkan akun utama.

    6. Di 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 google_colab_runtime_template_iam_policy resource Terraform 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:

    Akun 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