Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam Associate Cloud Engineer topic 1 question 36 discussion

Actual exam question from Google's Associate Cloud Engineer
Question #: 36
Topic #: 1
[All Associate Cloud Engineer Questions]

You have one project called proj-sa where you manage all your service accounts. You want to be able to use a service account from this project to take snapshots of VMs running in another project called proj-vm. What should you do?

  • A. Download the private key from the service account, and add it to each VMs custom metadata.
  • B. Download the private key from the service account, and add the private key to each VM's SSH keys.
  • C. Grant the service account the IAM Role of Compute Storage Admin in the project called proj-vm.
  • D. When creating the VMs, set the service account's API scope for Compute Engine to read/write.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
jackdbd
Highly Voted 2 years, 9 months ago
C is the correct answer. It took me a while to figure it out because I didn't understand how service accounts work across project. This article made it clear for me. https://gtseres.medium.com/using-service-accounts-across-projects-in-gcp-cf9473fef8f0 You create the service account in proj-sa and take note of the service account email, then you go to proj-vm in IAM > ADD and add the service account's email as new member and give it the Compute Storage Admin role.
upvoted 36 times
JelloMan
2 years ago
As of now, service accounts may be impersonated (new-term). AKA, you can create a service account in one project and then impersonate it in others. Essentially, it involves the same steps as what the medium article suggests (create a service account in the principal (main) project and then add the email of the main project to the project you want to impersonate) https://cloud.google.com/iam/docs/impersonating-service-accounts#impersonate-sa-level
upvoted 1 times
SaiSaiA
1 year, 9 months ago
I have tried C, it doesn't work. Also, this refers to a different Principal (user) impersonating a Service Account which is a different case from what is in the question.
upvoted 1 times
...
...
...
kishoredeena
Highly Voted 3 years, 10 months ago
Option C is the right one
upvoted 22 times
...
Captain1212
Most Recent 7 months, 2 weeks ago
Selected Answer: C
C seems more correct, because you want to use it, you need access for it
upvoted 1 times
...
sthapit
8 months, 1 week ago
C is the answer
upvoted 1 times
...
findsidd
8 months, 3 weeks ago
C is the correct answer. Compute Storage Admin (roles/compute.storageAdmin) has permissions to create, modify, and delete disks, images, and snapshots. For example, if your company has someone who manages project images and you don't want them to have the editor role on the project, then grant this role to their account on the project. The most common way to let an application authenticate as a service account is to attach a service account to the resource running the application. For example, you can attach a service account to a Compute Engine instance so that applications running on that instance can authenticate as the service account. Then, you can grant the service account IAM roles to let the service account—and, by extension, applications on the instance—access Google Cloud resources.
upvoted 1 times
...
Buruguduystunstugudunstuy
1 year, 1 month ago
Selected Answer: C
Answer C is correct. Grant the service account the IAM Role of Compute Storage Admin in the project called proj-vm. To take snapshots of VMs running in another project, you need to grant the service account that will take the snapshots the necessary IAM role to perform the action. In this case, granting the service account in the proj-sa project the Compute Storage Admin role in the proj-vm project will allow it to take snapshots of VMs running in that project. Answers A and B are incorrect because they involve downloading and adding the private key of the service account to each VM, which is not necessary and potentially risky. Answer D is also incorrect because setting the service account's API scope for Compute Engine to read/write only grants it permission to perform actions on resources within the same project. https://cloud.google.com/iam/docs/creating-managing-service-accounts https://cloud.google.com/iam/docs/granting-roles-to-service-accounts
upvoted 4 times
...
leogor
1 year, 5 months ago
C. Grant the service account the IAM Role of Compute Storage Admin in the project called proj-vm.
upvoted 1 times
...
habros
1 year, 8 months ago
Safe to eliminate any options that demand transferring of private keys. NOT SAFE Hence, C.
upvoted 3 times
theBestStudent
1 year, 6 months ago
highly agree with this thoughts! transferring private keys is a big no no here.
upvoted 1 times
...
...
RanjithK
1 year, 9 months ago
Answer is C
upvoted 1 times
...
AzureDP900
1 year, 10 months ago
C. is the correct answer Compute Storage Admin (roles/compute.storageAdmin) Permissions to create, modify, and delete disks, images, and snapshots. For example, if your company has someone who manages project images and you don't want them to have the editor role on the project, then grant this role to their account on the project. Lowest-level resources where you can grant this role: Disk Image Snapshot Beta
upvoted 4 times
...
haroldbenites
1 year, 11 months ago
go for C
upvoted 1 times
...
somenick
2 years, 1 month ago
Selected Answer: C
https://cloud.google.com/compute/docs/access/iam#compute.storageAdmin
upvoted 2 times
...
RealEL40
2 years, 4 months ago
When a service account is in one project, and it accesses a resource in another project, you usually must enable the API for that resource in both projects. For example, if you have a service account in the project my-service-accounts and a Cloud SQL instance in the project my-application, you must enable the Cloud SQL API in both my-service-accounts and my-application.
upvoted 2 times
...
shawnkkk
2 years, 5 months ago
C. Grant the service account the IAM Role of Compute Storage Admin in the project called proj-vm.
upvoted 1 times
...
vishnukumartr
2 years, 5 months ago
C. Grant the service account the IAM Role of Compute Storage Admin in the project called proj-vm.
upvoted 1 times
...
Jaira1256
2 years, 5 months ago
C is correct
upvoted 1 times
...
cuongnd
2 years, 9 months ago
C. Compute Storage Admin role has this: compute.snapshots.*
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...