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?

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