How can i change the current running project to another project in GCP (Google Cloud Platform) account using cli commands other than using
It could be that I'm late to answer, but this command made me learn a lot about gcloud SDK
gcloud alpha interactive
It's easier to discover by yourself that you'll need gcloud config set project my-project
.
However, what I like about gcloud is tab complication, so if you configure your gcloud config with configurations (I know it sounds weird but run this command gcloud config configurations list
) you can easily switch between your own projects that you usually work:
The alias that I use is:
alias gcca="gcloud config configurations activate"
and it works fine with zsh gcloud plugin.
EDIT: To configure one of configurations I usually do this
gcloud config configurations create [CUSTOM_NAME]
gcloud auth login # you can also manually set
gcloud config set project [gcp-project-id]
gcloud config set compute/zone europe-west3-c
gcloud config set compute/region europe-west3
You can use ENV variables too but I like when it's configured this way...