...

Text file src/edge-infra.dev/hack/scripts/delete-iam-keys.sh

Documentation: edge-infra.dev/hack/scripts

     1#!/usr/bin/env bash
     2
     3# xargs invocation isn't portable
     4echo "Unapologetically GNU only. OSXers must bring-your-own-glue."
     5
     6gcloud iam service-accounts keys list \
     7  --iam-account="$1"@"$2".iam.gserviceaccount.com \
     8  --format="value(name)" \
     9  --filter=keyType:USER_MANAGED | \
    10  xargs -r -n1 gcloud iam service-accounts keys delete \
    11  --iam-account="$1"@"$2".iam.gserviceaccount.com \
    12  --quiet

View as plain text