D4: Service Account Permissions & Assignment
Google Cloud Associate Cloud Engineer exam practice questions · 12 flashcards
Question
Service account as identity vs as resource?
1 / 12
Tip: Space flips the card, ← / → navigate.
Show all 12 Service Account Permissions & Assignment practice questions and answers
- Service account as identity vs as resource?Identity: it receives roles on resources. Resource: users receive roles on the SA.
- How do you grant a role to a service account?--member=serviceAccount:SA_EMAIL in add-iam-policy-binding.
- Which role lets a user attach an SA to a VM or service?Service Account User (roles/iam.serviceAccountUser) on the SA.
- How do you assign an SA to a VM?gcloud compute instances create ... --service-account=SA_EMAIL --scopes=cloud-platform.
- What are access scopes?Legacy OAuth limits on VMs; best practice: cloud-platform scope plus IAM roles.
- Can you change a VM's service account while running?No; stop the VM first.
- How do you set Cloud Run's identity?gcloud run deploy --service-account=SA_EMAIL.
- Which role manages SAs (create/delete)?Service Account Admin (roles/iam.serviceAccountAdmin).
- How do you grant access on the SA itself?gcloud iam service-accounts add-iam-policy-binding SA_EMAIL --member=... --role=...
- Why are SA keys risky?Long-lived credentials that can leak; prefer attached SAs, impersonation or federation.
- Max user-managed keys per SA?10.
- How do you list an SA's keys?gcloud iam service-accounts keys list --iam-account=SA_EMAIL.