Medium1 markMultiple Choice
Domain 1.3: Installing and configuring the CLIgcloudConfigurationProject Management

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

You are working in the Cloud Shell and want to deploy a Compute Engine instance. You realize your current active project is set to 'sandbox-123', but you need to deploy the instance in 'production-456'.

Which command should you run to change your active project for the current session?

Answer options:

A.

gcloud projects update production-456

B.

gcloud config set project production-456

C.

gcloud set default-project production-456

D.

gcloud compute project set production-456

How to approach this question

Recall the command used to modify gcloud properties.

Full Answer

B.gcloud config set project production-456✓ Correct
The `gcloud config set` command is used to set properties in your active configuration. To change the default project, you set the `project` property to the desired project ID.

Common mistakes

Using `gcloud projects...` commands, which interact with the Resource Manager API to modify the actual project in the cloud, rather than your local CLI state.

Practice the full GCP Associate Cloud Engineer Practice Exam 7

50 questions · hints · full answers · grading

More questions from this exam