New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Google Associate Cloud Engineer Exam - Topic 9 Question 72 Discussion

Actual exam question for Google's Associate Cloud Engineer exam
Question #: 72
Topic #: 9
[All Associate Cloud Engineer Questions]

You just installed the Google Cloud CLI on your new corporate laptop. You need to list the existing instances of your company on Google Cloud. What must you do before you run the gcloud compute instances list command?

Choose 2 answers

Show Suggested Answer Hide Answer
Suggested Answer: A, E

Before you run the gcloud compute instances list command, you need to do two things: authenticate with your user account and set the default project for gcloud CLI.

To authenticate with your user account, you need to run gcloud auth login, enter your login credentials in the dialog window, and paste the received login token to gcloud CLI.This will authorize the gcloud CLI to access Google Cloud resources on your behalf1.

To set the default project for gcloud CLI, you need to run gcloud config set project $my_project, where $my_project is the ID of the project that contains the instances you want to list.This will save you from having to specify the project flag for every gcloud command2.

Option B is not recommended, because using a service account key increases the risk of credential leakage and misuse.It is also not necessary, because you can use your user account to authenticate to the gcloud CLI3. Option C is not correct, because there is no such thing as a Cloud Identity user account key.Cloud Identity is a service that provides identity and access management for Google Cloud users and groups4. Option D is not required, because the gcloud compute instances list command does not depend on the default zone. You can list instances from all zones or filter by a specific zone using the --filter flag.


1: https://cloud.google.com/sdk/docs/authorizing

2: https://cloud.google.com/sdk/gcloud/reference/config/set

3: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys

4: https://cloud.google.com/identity/docs/overview

: https://cloud.google.com/sdk/gcloud/reference/compute/instances/list

Contribute your Thoughts:

0/2000 characters
Dwight
3 months ago
I thought you could just use your regular account without extra keys?
upvoted 0 times
...
Latrice
3 months ago
Yeah, I agree with the project setting, super important!
upvoted 0 times
...
Talia
3 months ago
Wait, do you really need a service account key for this?
upvoted 0 times
...
Keena
4 months ago
I think setting the default project is also a must.
upvoted 0 times
...
Alton
4 months ago
You definitely need to run gcloud auth login first!
upvoted 0 times
...
Alpha
4 months ago
I feel like setting the project is important, but I’m a bit confused about whether we need to set the zone as well. I guess I’ll go with A and E.
upvoted 0 times
...
Precious
4 months ago
I practiced a similar question, and I think we definitely need to run gcloud auth login. I’m not sure about the service account part though.
upvoted 0 times
...
Zana
4 months ago
I remember something about setting the default project, so option E sounds familiar. But I can't recall if we also need to set the zone.
upvoted 0 times
...
Levi
5 months ago
I think we need to authenticate first, so maybe option A is correct? But I'm not sure if we need to set the project too.
upvoted 0 times
...
Theodora
5 months ago
No problem, I've done this before. I'll just run the auth login and config set commands, and I should be good to go.
upvoted 0 times
...
Gertude
5 months ago
I remember learning about this in class. I think the key is to make sure I have the right permissions set up before running the command.
upvoted 0 times
...
Leigha
5 months ago
Wait, I'm a little confused. Do I need to create a service account or can I just use my regular user account?
upvoted 0 times
...
Nana
5 months ago
Okay, I've got this. I just need to authenticate with my Google Cloud account and set the default project.
upvoted 0 times
...
Trinidad
5 months ago
Hmm, this looks like a tricky one. I'll need to think through the steps carefully.
upvoted 0 times
...
India
5 months ago
I think the answer is A. Documenting and vetting user access is a great way for HR to help mitigate insider threats. The other options don't seem as directly relevant to the HR department's role.
upvoted 0 times
...
Adelina
5 months ago
This one seems straightforward. I'll focus on identifying the purpose that is not related to information security.
upvoted 0 times
...
Larae
2 years ago
Exactly! I was just about to say that. The auth login is the critical first step, and then we can configure the gcloud CLI to point to the right project and zone. I'd go with A, D, and E for this one.
upvoted 0 times
Gaynell
2 years ago
E) Run gcloud config set project $my_project to set the default project for gcloud CLI.
upvoted 0 times
...
Lonna
2 years ago
B) Create a Google Cloud service account, and download the service account key. Place the key file in a folder on your machine where gcloud CLI can find it.
upvoted 0 times
...
Shawana
2 years ago
A) Run gcloud auth login, enter your login credentials in the dialog window, and paste the received login token to gcloud CLI.
upvoted 0 times
...
...
Marge
2 years ago
Hmm, good point. I was thinking the same thing. We should probably do the auth login first, and then set the project and zone. Can't really do much without being authenticated, right?
upvoted 0 times
...
Sue
2 years ago
I agree, those options make the most sense. But I'm a little unsure about the auth part - don't we need to authenticate with Google Cloud before we can list the instances? Maybe option A is also required.
upvoted 0 times
...
Louvenia
2 years ago
This seems like a pretty straightforward question. I think the key things we need to do are set the default project and zone for the gcloud CLI, so I'd go with options D and E.
upvoted 0 times
...

Save Cancel