Hard1 markMultiple Choice

GCP ACE · Question 08 · Domain 1.3: Installing and configuring the CLI

You frequently switch between two different Google Cloud projects: 'dev-env' and 'prod-env'. Each project requires you to use a different Google account for authentication and a different default compute zone.

Which TWO actions should you take to switch between these environments with the LEAST amount of effort? (Select TWO)

Answer options:

A.

Create separate gcloud configurations using gcloud config configurations create

B.

Use gcloud config configurations activate to switch between the environments

C.

Run gcloud init every time you need to switch environments

D.

Create different OS user accounts on your workstation for each environment

E.

Pass the --account, --project, and --zone flags with every single gcloud command

How to approach this question

Identify the Cloud SDK feature designed specifically for managing multiple distinct environments (accounts + projects + zones).

Full Answer

The Cloud SDK supports multiple named configurations. A configuration is a set of properties (like active account, default project, default zone). By creating a configuration for 'dev' and another for 'prod' (`gcloud config configurations create`), you can easily switch all these settings at once using `gcloud config configurations activate [NAME]`.

Common mistakes

Thinking you must re-authenticate (`gcloud init` or `gcloud auth login`) every time you switch accounts.

Practice the full GCP Associate Cloud Engineer Practice Exam 5

50 questions · hints · full answers · grading

More questions from this exam