Skip to content

Instantly share code, notes, and snippets.

@mc2squared
Forked from DashLt/create_service.sh
Last active May 30, 2022 21:07
Show Gist options
  • Save mc2squared/01c933a8172a26af88285610a0e5af8d to your computer and use it in GitHub Desktop.
Save mc2squared/01c933a8172a26af88285610a0e5af8d to your computer and use it in GitHub Desktop.
Generate 100 service accounts and export their keys
#!/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
Copy link

dm4uz3 commented Jun 8, 2019

https://cdn.discordapp.com/emojis/400401023165923328.png?v=1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment