GCP configuration properties inconsistent output in cloudshell

78 views Asked by At

I am getting started with GCP and have a bit of confusion understanding the command output for gcloud config

I have created a new config using

gcloud config configurations create testconfig

While trying to check the existing configuration, I run the following command which shows that the ACCOUNT property is empty for the newly created configuration:

>gcloud config configurations list                                                                                                                                                    
NAME: cloudshell-10718
IS_ACTIVE: False
ACCOUNT: [email protected]
PROJECT: compact-system-401619
COMPUTE_DEFAULT_ZONE: us-east1-b
COMPUTE_DEFAULT_REGION: us-east1

NAME: testconfig
IS_ACTIVE: True
ACCOUNT: 
PROJECT: 
COMPUTE_DEFAULT_ZONE: 
COMPUTE_DEFAULT_REGION: 

However, running the following command shows that the account property is set:

>gcloud config list
[accessibility]
screen_reader = True
[component_manager]
disable_update_check = True
[compute]
gce_metadata_read_timeout_sec = 30
[core]
account = [email protected]
disable_usage_reporting = True
[metrics]
environment = devshell

Your active configuration is: [testconfig]

This feels inconsistent. I am sure I am missing something basic here but the GCP documentation did not help me here.

1

There are 1 answers

1
Ray John Navarro On

Based on the information you provided, the command ‘gcloud config configurations list’ generates a list of all configurations along with their properties The command ‘gcloud config list’ displays settings for the active configuration.

In context, running ‘gcloud config configurations list’ will provide the configurations and their properties but it doesn't indicate which configuration is currently active. While running gcloud config list displays the settings for the active configuration which is testconfig. Attached is the documentation for gcloud CLI that can serve as a reference.[1]

[1] https://cloud.google.com/sdk/gcloud