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 in your local terminal and need to use different default compute zones and authentication accounts for each.

What is the MOST efficient way to manage this in the Cloud SDK?

Answer options:

A.

Run 'gcloud init' every time you need to switch projects.

B.

Use the '--project', '--zone', and '--account' flags on every single gcloud command you run.

C.

Create two separate gcloud configurations using 'gcloud config configurations create' and switch between them.

D.

Install the Cloud SDK twice in different directories on your workstation.

How to approach this question

Understand how gcloud manages state. Look for the feature designed specifically for managing multiple environments.

Full Answer

C.Create two separate gcloud configurations using 'gcloud config configurations create' and switch between them.✓ Correct
Create two separate gcloud configurations using 'gcloud config configurations create' and switch between them.
The `gcloud config configurations` command group allows you to create multiple named configurations. Each configuration maintains its own set of properties, such as active account, default project, and default compute zone. You can easily switch between them using `gcloud config configurations activate [NAME]`.

Common mistakes

Relying on flags for every command, which is valid but not the *most efficient* way as requested by the question.

Practice the full GCP Associate Cloud Engineer Practice Exam 7

50 questions · hints · full answers · grading

More questions from this exam