Reputation: 23
It seems I can't just write the same question from the title in the body. Because it wouldn't meet the quality standards.
Upvotes: 1
Views: 2767
Reputation: 328
Run: gcloud projects list --impersonate-service-account=<your-service-account-email-address>
This requires Cloud Resource Manager API (cloudresourcemanager.googleapis.com) to be enabled and resourcemanager.projects.list permission for the service account.
The flag is very self-explanatory: It runs the commands as the given service account instead of your configured credentials.
Upvotes: 1