Managing Multiple GCP Accounts with gcloud Configurations
Short answer
A Create two configurations using gcloud config configurations create [NAME] and switch between them using gcloud config configurations activate [NAME].
Question
Compute Engine instance in these two Google Cloud Platform accounts using the command line interface. What should you do?
Key Takeaways
The exam tests your knowledge of gcloud context management, specifically trapping candidates with commands like 'list' that only display information rather than performing actions.
Learn how to manage multiple Google Cloud Platform accounts using gcloud configurations. This page clarifies that creating and activating distinct configurations is the correct method for switching contexts when provisioning resources.
Common mistake: Candidates often select options containing 'gcloud config list', mistakenly believing it activates a configuration or initiates resource creation, whereas it merely displays current settings.
Expert Analysis
Why the Answer Is Correct
Option A is the only valid approach because it correctly utilizes the two-step process required for managing multiple cloud contexts in the gcloud CLI. First, you must create named configurations using gcloud config configurations create to store specific account, project, region, and zone details. Second, you activate the desired configuration using gcloud config configurations activate, which sets the active context so that subsequent commands (like starting a Compute Engine instance) apply to the correct account and region.
Why the Other Options Are Wrong
Options B, C, and D all fail because they suggest using gcloud config configurations list. The list command is read-only; it displays the names of existing configurations but does not switch the active context nor does it execute any resource provisioning commands. You cannot start a Compute Engine instance by listing configurations. Additionally, Option C and D imply activating without creating, which is logically incomplete if the configurations do not yet exist, but the fatal flaw remains the use of the list command as an action trigger.
Community Comment Notes
Community consensus strongly supports Option A, with multiple users highlighting the absurdity of using 'list' commands to start instances. As leba noted, "gcloud config configurations list does not help create instances." Other commenters emphasized that configurations are essentially saved profiles that must be activated to switch contexts, reinforcing why A is the only functional workflow.
Official Reference
https://cloud.google.com/sdk/gcloud/reference/config/configurations
This link opens the official vendor documentation in a new tab.
Exam Strategy
Always distinguish between commands that modify state (create, set, activate) and those that view state (list, get). In gcloud questions involving multiple environments, look for the pattern of 'create then activate' to switch contexts effectively.
Frequently Asked Questions
Why can't I just use gcloud auth login for each account?
What is the difference between gcloud config set and gcloud config configurations create?
Discussion 67 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 30 of 67
-
leba 👍 38Correct answer is A as you can create different configurations for each account and create compute instances in each account by activating the respective account.Refer GCP documentation - Configurations Create & Activate Options B, C & D are wrong as gcloud config configurations list does not help create instances. It would only lists existing named configurations.
-
Buruguduystunstugudunstuy 👍 7 Answered AAnswer A is the correct answer. To start a new Compute Engine instance in different GCP accounts using the command line interface, you can create two configurations using gcloud config configurations create [NAME], where [NAME] is the name of the configuration for each account. Then, you can switch between accounts using gcloud config configurations and activate [NAME] before running the gcloud compute instances create command to create the instance. Answer B is incorrect because running gcloud configurations list only lists the available configurations and does not start Compute Engine instances. Answer C is incorrect because activating configurations using gcloud configurations activate [NAME] only switches the current configuration, but does not start Compute Engine instances. Answer D is incorrect because running gcloud configurations list only lists the available configurations and does not start Compute Engine instances.
-
Khaled_Rashwan 👍 7A is correct account information is saved in the "configurations". you can have more than one "configurations" but only one is active at a time. you can create two configurations and one for each account then switch between them using: gcloud config configurations activate. Also, you can change the account details in the active configurations using: gcloud config set core/account <account-name>
-
theBestStudent 👍 6Obviously A is correct. All the other options don't make any sense when day say "Run gcloud configurations list to start the Compute Engine instances". How the heck are you expecting to "start" GCE instances doing "configuration list". Obviously B,C,D don't make any sense.
-
cloudenthu01 👍 5you cannot switch accounts without creating configuration which is created using gcloud config configurations create [CONFIGNAME] ....which has desired zone/regions/projects defined in them and then switch accounts using gcloud config configurations activate [CONFIGNAME] then run gcloud compute create instances [INSTANCES] which is created in region/zone by switching config accounts. Answer is A.
Show 25 more comments
-
gspb 👍 5Obviously A is the correct option here. Even if u dont know this, u can eliminate the remaining options since by common sense u can say that the "list" command doesnt start but list the required things.
-
YourCloudGuru 👍 4 Answered AThe correct answer is A This option allows you to create and activate different configurations for your GCP accounts. This way, you can easily switch between accounts and run commands without having to re-enter your credentials. The other options are not as good: Option B does not specify how to switch between accounts when running the commands to start the Compute Engine instances. Option C does not specify how to create configurations for your GCP accounts. * Option D does not specify how to start the Compute Engine instances.
-
ahmed812 👍 3we cannot activate two configurations at a time. So A seems appropriate gcloud config configurations activate CONFIGURATION_NAME [GCLOUD_WIDE_FLAG …]
-
jmugambi 👍 2 Answered AA is the only option. By elimination: B/C/D have "gcloud config" or 'gcloud configurations' as a way to create compute instances which is wrong. Right command begins with 'gcloud compute' Correct method: create configurations -> create instances in active config -> switch configuration -> create instances in newly active config
-
gspb 👍 2Obviously A is the correct option here. Even if u dont now this u can eliminate he remaining options since by common sense u can say that the "list" command doesnt start but list the required things.
-
sumanshu 👍 2Vote for 'C' . A & B - out because they mention 'CREATING' the configurations. Why we need to re-create it? option D is out - command is wrong
-
saurabh1805 👍 2A is correct answer, Please refer below document for more details. https://cloud.google.com/sdk/gcloud/reference/config/configurations#COMMAND
-
Neha_Pallavi 👍 2Yes A is the correct Answer. using the gcloud configurations,we can create the we need to run the another compute engine instance
-
AnjuMaria 👍 2gcloud config list will not start a compute engine instance. So B,C,D are incorrect. A is the correct answer.
-
saurabh1805 👍 2A is correct answer https://cloud.google.com/sdk/gcloud/reference/config/configurations#COMMAND
-
JackGlemins 👍 2A is right:https://cloud.google.com/sdk/docs/configurations#activating_a_configuration
-
test157 👍 2 Answered AA is the correct answer!
-
mlantonis 👍 2A is the correct answer
-
Urticas 👍 1 Answered AWhen you need to manage multiple Google Cloud accounts, regions, or zones using the gcloud CLI, the recommended approach is to use named configurations. Each configuration can store: Account credentials Project ID Default region Default zone This allows you to easily switch contexts without re‑specifying flags every time.
-
ermlol13 👍 1 Answered AThe Answer is A. gcloud compute instances create in one account, run the activation switch, and run the exact same creation command for the second account without manually rewriting your authentication tokens or zone flags every single time.
-
Hi2ALL 👍 1C is correct answer we need to focus "activate" EXAMPLES To activate an existing named configuration, run: gcloud config configurations activate my_config To list all properties in the activated configuration, run: gcloud config list --all
-
JKRowlings 👍 1A seems to be the right answer. gcloud config list - list Cloud SDK properties for the currently active configuration and does not start the configuration. gcloud config configurations activate start an inactive configuration.
-
satish2010a 👍 1Ans - A. Create two configurations using gcloud config configurations create [NAME]. Run gcloud config configurations activate [NAME] to switch between accounts when running the commands to start the Compute Engine instances.
-
swatititame 👍 1• A. Create two configurations using gcloud config configurations create [NAME]. Run gcloud config configurations activate [NAME] to switch between accounts when running the commands to start the Compute Engine instances.
-
shawnkkk 👍 1A. Create two configurations using gcloud config configurations create [NAME]. Run gcloud config configurations activate [NAME] to switch between accounts when running the commands to start the Compute Engine instances.
-
yas_cloud 👍 1Should this not be A? Reason being option C, D talk about activating both configurations which is not possible. Option B talks about running a 'list'command to activate a configuration which wont happen.
-
XRiddlerX 👍 1Are you implying that B,C,D are incorrect because "gcloud configurations activate" doesn't exist and that A is the only obvious choice? I'm not sure I understand your comment.
-
krunals 👍 1A is correct option as it contains right command gcloud config configurations activate All other options miss config keyword in command and hence easy to rule out
-
Joh3o8an 👍 1I think A is the correct answer. You can't start a compute engine with "gcloud config list" but rather to view the properties of your active configurations.
-
ApaMokus 👍 1A is the correct anwer. B is inappropriate as list commend does not start VMs. C&D are incorrect as you cannot have two active configurations at a time.
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All ACE Questions
Access 84 questions with complete answers and detailed explanations.
View Full ACE Practice Test →