💡

gcloud CLI のTips

2023/05/27に公開
新しいコンフィグを追加する
bash
gcloud config configurations create CONFIGURATION_NAME
gcloud config configurations activate CONFIGURATION_NAME
gcloud auth login
gcloud projects list
gcloud config list
gcloud config set project PROJECT_ID
gcloud services list --available
gcloud services enable compute.googleapis.com
gcloud compute regions list
gcloud config set compute/region asia-northeast1
gcloud config list

結果,

bash
[accessibility]
screen_reader = False
[compute]
region = asia-northeast1
[core]
account = <USERNAME>
disable_usage_reporting = True
project = <PROJECT_NAME>
コンフィグを切り替える
bash
gcloud config configurations activate CONFIGURATION_NAME
コンフィグを設定する
bash
gcloud config set SECTION/PROPERTY VALUE
現在のコンフィグを確認する
bash
gcloud config list

https://cloud.google.com/sdk/docs/configurations?hl=ja

Discussion