Medium1 markMultiple Choice

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

You are working in Cloud Shell and your current default project is set to 'dev-project-123'. You need to run several commands against resources in 'prod-project-999' without having to append the --project flag to every command.

Which command should you use to change your default project for the current session?

Answer options:

A.

gcloud set project prod-project-999

B.

gcloud config set project prod-project-999

C.

gcloud projects update prod-project-999 --default

D.

gcloud config update project prod-project-999

How to approach this question

Remember the structure for modifying local SDK properties: gcloud config set [PROPERTY] [VALUE].

Full Answer

B.gcloud config set project prod-project-999✓ Correct
The `gcloud config set` command is used to set properties in your active configuration. To change the default project, you use `gcloud config set project [PROJECT_ID]`.

Common mistakes

Forgetting the 'config' part of the command and guessing `gcloud set project`.

Practice the full GCP Associate Cloud Engineer Practice Exam 3

50 questions · hints · full answers · grading

More questions from this exam