Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save packetpilot/c3021949c75a655bb4f719b9060d80a5 to your computer and use it in GitHub Desktop.

Select an option

Save packetpilot/c3021949c75a655bb4f719b9060d80a5 to your computer and use it in GitHub Desktop.

Revisions

  1. packetpilot created this gist Aug 3, 2018.
    7 changes: 7 additions & 0 deletions Search for service account identifier across all GCP projects
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    # 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