A healthcare enterprise manages several data analytics workloads across multiple projects contained within a folder named Clinical-Analytics in its Google Cloud resource hierarchy. A deployment automation pipeline uses a primary service account to create Compute Engine instances in any project under this folder. The pipeline must also attach an existing runtime service account to these newly provisioned instances. Which IAM role configuration meets these requirements while enforcing the principle of least privilege?
- Grant Compute Instance Admin (roles/compute.instanceAdmin.v1) on the Clinical-Analytics folder to the deployment service account, and grant Service Account User (roles/iam.serviceAccountUser) on the runtime service account resource to the deployment service account.Answer
- BGrant Editor (roles/editor) on the Clinical-Analytics folder to the deployment service account so it inherits all required Compute Engine and IAM permissions across child projects.
- CGrant Compute Instance Admin (roles/compute.instanceAdmin.v1) on the Clinical-Analytics folder to the deployment service account, and grant Service Account Admin (roles/iam.serviceAccountAdmin) on the runtime service account to the deployment service account.
- DGrant Compute Instance Admin (roles/compute.instanceAdmin.v1) and Service Account User (roles/iam.serviceAccountUser) at the Organization node level to ensure all resource movement across folders automatically prevents unauthorized data exfiltration.
Answer
Grant Compute Instance Admin (roles/compute.instanceAdmin.v1) on the Clinical-Analytics folder to the deployment service account, and grant Service Account User (roles/iam.serviceAccountUser) on the runtime service account resource to the deployment service account.
The correct solution leverages resource hierarchy inheritance by assigning Compute Instance Admin at the folder node level, granting provisioning permissions across all child projects. Scoping the Service Account User role directly on the runtime service account resource grants the automation account exact permission to attach the identity to instances without granting service account management rights.
Step-by-Step Solution
Key Concept
Resource Hierarchy IAM Inheritance & Service Account Impersonation
Estimated Time:2m 0s