Skip to content

Instantly share code, notes, and snippets.

@grant

grant/sa.sh

Last active Aug 1, 2020
Embed
What would you like to do?
Create a Service Account
# Get the current project
PROJECT=$(gcloud config get-value core/project 2> /dev/null)
# Create a service account (aka robot account)
gcloud iam service-accounts create sa-name \
--description="sa-description" \
--display-name="sa-display-name"
# Create and download credentials for the service account
gcloud iam service-accounts keys create creds.json \
--iam-account sa-name@$PROJECT.iam.gserviceaccount.com
# Copy service account email
echo "sa-name@$PROJECT.iam.gserviceaccount.com" | pbcopy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.