diff options
author | Santo Cariotti <santo@dcariotti.me> | 2024-12-27 22:22:35 +0100 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2024-12-27 22:22:35 +0100 |
commit | 299f5ab9c38834fc58b2f2a434c1495ac3d1c554 (patch) | |
tree | 319dbf5aa7a9d507b985760e860934484002ca4b /scripts/00-create-service-account.sh | |
parent | fc35b02c84c94d5965a8317df6312c9a3ececc68 (diff) |
Add scripts
Diffstat (limited to 'scripts/00-create-service-account.sh')
-rwxr-xr-x | scripts/00-create-service-account.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/00-create-service-account.sh b/scripts/00-create-service-account.sh new file mode 100755 index 0000000..984e55b --- /dev/null +++ b/scripts/00-create-service-account.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +gcloud iam service-accounts create ${SERVICE_ACCOUNT} \ + --description="Spark access account to Google Cloud Buckets" \ + --display-name="Spark to Bucket" + +gcloud projects add-iam-policy-binding ${PROJECT} \ + --member="serviceAccount:${SERVICE_ACCOUNT}@${PROJECT}.iam.gserviceaccount.com" \ + --role="roles/storage.objectAdmin" + +gcloud projects add-iam-policy-binding ${PROJECT} \ + --member="serviceAccount:${SERVICE_ACCOUNT}@${PROJECT}.iam.gserviceaccount.com" \ + --role="roles/dataproc.worker" + +gcloud iam service-accounts keys create ./google-service-account-key.json \ + --iam-account=${SERVICE_ACCOUNT}@${PROJECT}.iam.gserviceaccount.com |