0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

gcloud config configurations関連(メモ)

Last updated at Posted at 2020-11-29

gcloud config configurationsの自分用メモ

別アカウントとか、別プロジェクトの切り替えをする必要があったので、色々調べてみました。

参考にさせていただいた記事

gcloud configで複数の設定を持って切り替える
https://qiita.com/sky0621/items/597d4de7ed9ba7e31f6d

configurations 一覧参照

memo: IS_ACTIVATE が現在有効なconfigurations

gcloud config configurations list
#### 結果 ####
NAME        IS_ACTIVE  ACCOUNT                  PROJECT             COMPUTE_DEFAULT_ZONE  COMPUTE_DEFAULT_REGION
aaa         True       yyyyyyyy@gmail.com       prj2
default     False      xxxxxxxx@gmail.com       prj1

configurationsの作成

configurationsを新規作成する。

gcloud config configurations create new_config_name
#### 結果 ####
Created [new_config_name].
Activated [new_config_name].

configurationsの変更

指定のconfigurationsをactivateする。

gcloud config configurations activate default
#### 結果 ####
Activated [default].

configurationsの削除

指定のconfigurationsを削除する。

gcloud config configurations delete cnf

#### 結果 ####
The following configurations will be deleted:
 - cnf
Do you want to continue (Y/n)?  Y   #←削除確認

Deleted [cnf].

参考まで
ActivateしたままDeleteを実行すると、下記エラーが発生するので、
別のconfigurationsをactivateした後に削除する。


ERROR: (gcloud.config.configurations.delete) Deleting named configuration failed because configuration [newcnf] is set as active.  Use `gcloud config configurations activate` to change the active configuration.
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?