Hard1 markMultiple Choice
Domain 5.2: Managing service accountsIAMService AccountsCross-ProjectCloud Functions

GCP ACE · Question 45 · Domain 5.2: Managing service accounts

You have a CI/CD pipeline running in 'Project-A'. The pipeline needs to deploy a Cloud Function into 'Project-B'. The pipeline authenticates using a Service Account located in 'Project-A'.

Which TWO steps are required to allow the pipeline to deploy the function? (Select TWO)

Answer options:

A.

Grant the Service Account from Project-A the 'Cloud Functions Developer' role in Project-B.

B.

Copy the Service Account from Project-A to Project-B.

C.

Grant the Service Account from Project-A the 'Service Account User' role on the runtime service account in Project-B.

D.

Set up VPC Network Peering between Project-A and Project-B.

E.

Create a new Service Account in Project-B and link it to Project-A.

How to approach this question

Understand cross-project IAM and the permissions required to deploy compute resources.

Full Answer

Service accounts can be granted roles in projects other than the one they were created in. To deploy a Cloud Function, the deploying identity needs two things: 1) Permission to create the function (Cloud Functions Developer). 2) Permission to attach a runtime service account to the function (Service Account User role on the target service account).

Common mistakes

Forgetting the 'Service Account User' role, which is a common cause of deployment failures.

Practice the full GCP Associate Cloud Engineer Practice Exam 2

50 questions · hints · full answers · grading

More questions from this exam