Alexander Tissen
Alexander Tissen

Reputation: 23

Is there a way to find out to which projects a GCP service account has access to?

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

Answers (1)

Fleuri
Fleuri

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

Related Questions