Medium1 markMultiple Choice
GCP ACE · Question 07 · Domain 1.3: Installing and configuring the CLI
You work on two different Google Cloud projects: 'dev-project' and 'prod-project'. You frequently switch between them and need to use different accounts and default compute zones for each.
What is the MOST efficient way to manage these different settings in the Cloud SDK?
You work on two different Google Cloud projects: 'dev-project' and 'prod-project'. You frequently switch between them and need to use different accounts and default compute zones for each.
What is the MOST efficient way to manage these different settings in the Cloud SDK?
Answer options:
A.
Run gcloud init every time you need to switch projects.
B.
Create two separate gcloud configurations and switch between them using 'gcloud config configurations activate'.
C.
Use the --project, --account, and --zone flags on every single gcloud command you run.
D.
Install the Cloud SDK twice in different directories on your workstation.
How to approach this question
Understand how gcloud handles multiple environments. The 'configurations' feature is designed exactly for this use case.
Full Answer
B.Create two separate gcloud configurations and switch between them using 'gcloud config configurations activate'.✓ Correct
A gcloud configuration is a named set of SDK properties. These properties include the active account, default project, and default compute zone/region. By creating multiple configurations (e.g., one for dev, one for prod), you can quickly switch contexts using `gcloud config configurations activate [NAME]` without having to re-authenticate or manually change individual settings.
Common mistakes
Thinking you have to manually change the project (`gcloud config set project`) and account every time you switch contexts.
Practice the full GCP Associate Cloud Engineer Practice Exam 6
50 questions · hints · full answers · grading
More questions from this exam
Q01What is the primary purpose of a Google Cloud project?EasyQ02Your development team needs to manage Compute Engine instances in a specific project. They need t...MediumQ03You are automating the setup of a new Google Cloud project using a bash script. You need to enabl...EasyQ04Your startup has a strict monthly cloud budget of $500. You want to be notified immediately if yo...MediumQ05Your finance team wants to perform granular analysis of your Google Cloud spending using SQL. The...Hard
Expert