Skip to content

Instantly share code, notes, and snippets.

@danbills
Created August 29, 2019 19:23
Show Gist options
  • Save danbills/47be093cfa464edec797baf02adeaf19 to your computer and use it in GitHub Desktop.
Save danbills/47be093cfa464edec797baf02adeaf19 to your computer and use it in GitHub Desktop.
minimal way to create a service account suitable for running cromwell on Google GCP Pipelines API
EMAIL=$(gcloud beta iam service-accounts create $1 --description "foo" --display-name "danb-perf-display-name" --format json | jq '.email' | sed -e 's/\"//g')
for i in storage.objectCreator storage.objectViewer genomics.pipelinesRunner genomics.admin iam.serviceAccountUser storage.objects.create
do
gcloud projects add-iam-policy-binding $2 --member serviceAccount:$EMAIL --role roles/$i
done
gcloud iam service-accounts keys create sa.json --iam-account $EMAIL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment