Search code examples
google-cloud-platformgcloudgoogle-cloud-shell

How to Switch between Configurations in Google Cloud Platform CLI - Cloud Shell


I have multiple configurations created via the gcloud init command. How can I switch between configurations in the Google Cloud Shell (CLI)?


Solution

  • You should be able to:

    • gcloud config configurations list;
    • gcloud config configurations activate ...
    • etc.

    See: https://cloud.google.com/sdk/gcloud/reference/config/configurations

    NOTE Instead of changing the current config globally, you may also explicitly specify the configuration per command,e.g.:

    gcloud [some-command] --configuration=[your-config]