Cloud Shell で gcloud
コマンドを実行する
Cloud Shell で gcloud CLI コマンドを実行する方法を説明します。
このタスクを Cloud Shell エディタで直接行う際の順を追ったガイダンスについては、[ガイドを表示] をクリックしてください。
始める前に
- 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
(
roles/resourcemanager.projectCreator
), which contains theresourcemanager.projects.create
permission. 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
(
roles/resourcemanager.projectCreator
), which contains theresourcemanager.projects.create
permission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
gcloud
プロパティの設定
- Cloud Shell エディタを起動する
コアプロパティを設定して、ターミナルにメッセージを出力するときに色が使用されないようにします。
gcloud config set disable_color true
disable_color
プロパティの設定を解除します。gcloud config unset disable_color
Compute Engine API を有効にしている場合は、優先する Compute Engine リージョンを設定します。
REGION
は、リージョン名(例:us-east1
)に置き換えます。gcloud config set compute/region REGION
あるいは、優先ゾーンを設定することもできます。
ZONE
は、ゾーン名(例:us-east1-b
)に置き換えます。gcloud config set compute/zone ZONE
Compute Engine のリージョンとゾーンについては、リージョンとゾーンをご覧ください。
使用できるプロパティの一覧を表示します。
gcloud topic configurations
コアコマンドを実行する
認証情報がローカル システムに保存されているアカウントを一覧表示します。
gcloud auth list
gcloud CLI は、認証されたアカウントのリストを表示します。
ACCOUNT_EMAIL
は 1 つ以上のアクティブなアカウントのリストを表します。Credentialed Accounts ACTIVE ACCOUNT \*
ACCOUNT_EMAIL
アクティブな gcloud CLI 構成のプロパティを一覧表示します。
gcloud config list
gcloud CLI は以下のようなプロパティのリストを表示します。
ACCOUNT_EMAIL
とPROJECT_ID
はメールアドレスとプロジェクト ID を示します。[core] account = ACCOUNT_EMAIL disable_usage_reporting = False project = PROJECT_ID
gcloud CLI のインストール状況と有効な構成に関する情報を表示します。
gcloud info
gcloud
コマンドのヘルプを表示する
gcloud compute instances create
コマンドのヘルプを表示します。gcloud help compute instances create
gcloud topic
で使用可能なコマンドを表示します。gcloud help topic
フィルタリングに関する情報を表示します。
gcloud topic filters
gcloud
コマンドの構造について詳細を確認します。gcloud topic command-conventions