How to change the project in GCP using CLI commands

前端 未结 16 1736
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-29 18:07

How can i change the current running project to another project in GCP (Google Cloud Platform) account using cli commands other than using

16条回答
  •  暖寄归人
    2021-01-29 18:52

    For what its worth if you have a more than a handful of projects, which I do, use:

    gcloud init

    This will list all your projects and give you the option to change current project settings, add a new project configuration or switch:

    Pick configuration to use:
     [1] Re-initialize this configuration [esqimo-preprod] with new settings
     [2] Create a new configuration
     [3] Switch to and re-initialize existing configuration: [default]
     [4] Switch to and re-initialize existing configuration: [project 1]
     [5] Switch to and re-initialize existing configuration: [project 2]
    Please enter your numeric choice:
    

    It will always ask you to login and display options for different google accounts that you may have.

    Given that I manage multiple organisations and projects this approach lets' me to simply switch between them.

提交回复
热议问题