Medium1 markMultiple Choice
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?
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
Q01You are starting a new initiative and need to create a new Google Cloud project using the Cloud S...EasyQ02Your company is migrating to Google Cloud and wants to manage user identities centrally. They cur...MediumQ03You have just created a new Google Cloud project and want to deploy a containerized application u...MediumQ04Your finance team wants to perform complex SQL queries on your Google Cloud billing data to analy...MediumQ05You are managing a development project in Google Cloud. You want to ensure that you are notified ...Easy
Expert