gcloud
command line tool allow us managing a list of Google Cloud projects, one of which is considered as the default project, so all the operations we perform via gcloud
are performed on it.
Available projects
To check what projects are available via
gcloud
, run the command:
$ gcloud projects list
This command drops an output similar to this example:
PROJECT_ID NAME PROJECT_NUMBER
fooOrg-pr01 Project Bar 239785793387
fooOrg-pr02 Project Zaz 348328582382
...
You can check the available options in the GCloud SDK reference.
Current default project
As you can see, that output doesn't set what is the default project. To get it run this command:
$ gcloud config get-value project
The command output will show the ID of the default project. Following the above example, the output of the command could be
fooOrg-pr01
to state that the default project is our Project Bar.
Changing the current default project
To change the default project, run this command:
$ gcloud config set project <project-ID>
So following the previous example, to set our
Project Zaz
as default, this command should be run:
$ gcloud config set project fooOrg-pr02
Comentarios
Publicar un comentario