-
-
Save mc2squared/01c933a8172a26af88285610a0e5af8d to your computer and use it in GitHub Desktop.
Generate 100 service accounts and export their keys
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# requires gcloud command line tools; go to https://cloud.google.com/sdk/docs/quickstarts to get them | |
# max 100 service accounts per project | |
# run gcloud init --console-only first and select a project | |
# | |
# Want to use these for rclone? Service Account Loadbalancing is implemented in this build: | |
# https://git.fionera.de/fionera/rclone/releases | |
KEYS_DIR=~/keys | |
for name in service{1..100}; do | |
echo $name | |
gcloud iam service-accounts create $name | |
done | |
for name in $(gcloud iam service-accounts list --format='value(email)'); do | |
echo $name | |
gcloud iam service-accounts keys create $KEYS_DIR/$name.json --iam-account=$name | |
done | |
gcloud iam service-accounts list --format='value(email)' |
dm4uz3
commented
Jun 8, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment