Medium1 markMultiple Choice
Domain 5.2: Managing service accountsDomain 5Service AccountsIAMCross-Project

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

You have a Compute Engine VM running in Project A. The application on this VM needs to write data to a BigQuery dataset located in Project B.

Which TWO steps must you take to configure this cross-project access securely? (Select TWO)

Answer options:

A.

Attach a service account to the VM in Project A

B.

Grant that service account the roles/bigquery.dataEditor role in Project B

C.

Create a service account in Project B and attach it to the VM in Project A

D.

Download a JSON key for a service account in Project B and store it on the VM in Project A

E.

Set up VPC Network Peering between Project A and Project B

How to approach this question

Understand how IAM works across projects. The identity lives in one project, and the permission is granted in the other.

Full Answer

Attach a service account to the VM in Project A, Grant that service account the roles/bigquery.dataEditor role in Project B
To enable cross-project access, you use IAM. First, you ensure the VM in Project A runs as a specific service account (e.g., `app-sa@project-a.iam.gserviceaccount.com`). Then, you go to Project B (where BigQuery is), open IAM, and grant that specific email address the required role (e.g., `roles/bigquery.dataEditor`). GCP handles the cross-project authentication automatically.

Common mistakes

Thinking you need VPC peering for API access, or resorting to downloading JSON keys.

Practice the full GCP Associate Cloud Engineer Practice Exam 5

50 questions · hints · full answers · grading

More questions from this exam