Last active
December 18, 2018 02:32
-
-
Save b0noI/18454d66feedbf99ae42d24cf974f13b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| PROJECT_ID="" # PUT YOUR PROJECT ID | |
| SERVICE_ACCOUNT_NAME="" # Service account name | |
| GOOGLE_ACCOUNT_MAIL="" # user mail | |
| gcloud iam service-accounts add-iam-policy-binding \ | |
| "${SERVICE_ACCOUNT_NAME}@${PROJECT_ID}.iam.gserviceaccount.com" \ | |
| --member="user:${GOOGLE_ACCOUNT_MAIL}" --role="roles/iam.serviceAccountUser" | |
| # Replace osAdminLogin with osLogin if you do NOT want the user to have an | |
| # ability to act as root. | |
| gcloud projects add-iam-policy-binding ${PROJECT_ID} \ | |
| --member="serviceAccount:${SERVICE_ACCOUNT_NAME}@${PROJECT_ID}.iam.gserviceaccount.com" \ | |
| --role="roles/compute.osAdminLogin" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment