Created
March 18, 2019 01:54
-
-
Save gavinzhou/16f126436b2a7335fe9d50a86949ffdc to your computer and use it in GitHub Desktop.
How to use multiple service accounts with gcloud
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ gcloud config configurations create my-project1-config | |
$ gcloud config configurations activate my-project1-config | |
$ gcloud auth login # or activate-service-account | |
$ gcloud config set project project1 # and any other configuration you need to do | |
$ gcloud config configurations create my-project2-config | |
$ gcloud config configurations activate my-project2-config | |
$ gcloud auth login # or activate-service-account | |
$ gcloud config set project project2 # and any other configuration you need to do | |
$ CLOUDSDK_ACTIVE_CONFIG_NAME=my-project1-config gcloud ... | |
$ CLOUDSDK_ACTIVE_CONFIG_NAME=my-project2-config gcloud ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment