Menjalankan perintah gcloud dengan Cloud Shell
Pelajari cara menjalankan perintah gcloud CLI di Cloud Shell.
Untuk mengikuti panduan langkah demi langkah tugas ini langsung di Cloud Shell Editor, klik Pandu saya:
Sebelum memulai
- 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 role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
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.
Menetapkan properti gcloud
- Luncurkan Cloud Shell Editor.
Mencegah warna digunakan saat mencetak pesan ke terminal dengan menetapkan properti inti:
gcloud config set disable_color trueBatalkan setelan properti
disable_color:gcloud config unset disable_colorJika Anda telah mengaktifkan Compute Engine API, tetapkan region Compute Engine pilihan Anda. Ganti
REGIONdengan nama region—misalnya,us-east1:gcloud config set compute/region REGIONAtau, Anda dapat menyetel zona pilihan Anda. Ganti
ZONEdengan nama zona—misalnya,us-east1-b:gcloud config set compute/zone ZONEUntuk mengetahui informasi tentang region dan zona Compute Engine, lihat Region dan zona.
Menampilkan daftar properti yang tersedia:
gcloud topic configurations
Menjalankan perintah inti
Mencantumkan akun yang kredensialnya disimpan di sistem lokal:
gcloud auth listgcloud CLI menampilkan daftar akun yang memiliki kredensial, dengan
ACCOUNT_EMAILmewakili daftar satu atau beberapa akun aktif:Credentialed Accounts ACTIVE ACCOUNT \*
ACCOUNT_EMAILMencantumkan properti dalam konfigurasi gcloud CLI aktif Anda:
gcloud config listgcloud CLI menampilkan daftar properti yang mirip dengan berikut ini, dengan
ACCOUNT_EMAILdanPROJECT_IDmenampilkan email dan project ID Anda:[core] account = ACCOUNT_EMAIL disable_usage_reporting = False project = PROJECT_ID
Melihat informasi tentang penginstalan gcloud CLI dan konfigurasi aktif Anda:
gcloud info
Melihat bantuan untuk perintah gcloud
Melihat bantuan untuk perintah
gcloud compute instances create:gcloud help compute instances createLihat perintah yang tersedia di bagian
gcloud topic:gcloud help topicMelihat informasi tentang pemfilteran:
gcloud topic filtersPelajari lebih lanjut struktur perintah
gcloud:gcloud topic command-conventions