Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save packetpilot/c3021949c75a655bb4f719b9060d80a5 to your computer and use it in GitHub Desktop.
Save packetpilot/c3021949c75a655bb4f719b9060d80a5 to your computer and use it in GitHub Desktop.
Search for service account identifier across all GCP projects
# this slow-and-dirty one-liner has been split for readability
for p in $(gcloud projects list | cut -d ' ' -f 1 | grep -v PROJECT_ID); do \
gcloud config set project "${p}" && \
echo "${p}:" && \
gcloud iam service-accounts list \
| grep '12345678901'; \
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment