An enterprise media processing team is setting up an automated Deployment Manager pipeline to provision a fleet of Compute Engine instances managed by a regional Managed Instance Group (MIG). The deployment pipeline runs under a dedicated deployment service account `[email protected]`. The Compute Engine instances must run under a separate application runtime service account `[email protected]`. During the initial pipeline run, instance template creation fails with an IAM permission error when attempting to attach `app-runner` to the VM template. Which IAM configuration resolves the deployment failure while adhering to the principle of least privilege?
- Grant the Service Account User role (roles/iam.serviceAccountUser) on the app-runner service account to the deploy-sa service account.Cevap
- BGrant the Service Account Admin role (roles/iam.serviceAccountAdmin) at the project level to the deploy-sa service account.
- CGrant the Owner primitive role (roles/owner) on the app-runner service account to the deploy-sa service account.
- DSubmit a regional quota increase request for Compute Engine API service account attachments before executing the deployment pipeline.
Cevap
Granting the Service Account User role (`roles/iam.serviceAccountUser`) on the `app-runner` service account to the `deploy-sa` deployment service account allows the deployment pipeline to attach `app-runner` to Compute Engine instances under the principle of least privilege.
To attach a service account to a Compute Engine instance template or VM, the identity running the provisioning job must have the `iam.serviceAccounts.actAs` permission on the target service account. The predefined role `roles/iam.serviceAccountUser` grants this permission. Applying this role at the resource level on the target service account enforces least privilege.
Adım Adım Çözüm
Anahtar Kavram
Compute Engine Service Account Impersonation and Attachment Permissions