Forked from mjroeleveld/restore-default-gcp-serviceaccounts.sh
Created
June 12, 2020 21:06
-
-
Save gautamr/1301e895aa681895ba6fd6938e73eaf3 to your computer and use it in GitHub Desktop.
Restore default GCP service accounts
This file contains 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=project | |
PROJECT_NUMBER=1343214123423 | |
# GKE | |
gcloud projects add-iam-policy-binding $PROJECT --member=serviceAccount:service-$PROJECT_NUMBER@container-engine-robot.iam.gserviceaccount.com --role=roles/container.serviceAgent | |
gcloud projects add-iam-policy-binding $PROJECT --member=serviceAccount:service-$PROJECT_NUMBER@containerregistry.iam.gserviceaccount.com --role=roles/editor | |
# Compute | |
gcloud projects add-iam-policy-binding $PROJECT --member=serviceAccount:[email protected] --role=roles/editor | |
gcloud projects add-iam-policy-binding $PROJECT --member=serviceAccount:[email protected] --role=roles/compute.serviceAgent | |
# APIs | |
gcloud projects add-iam-policy-binding $PROJECT --member=serviceAccount:[email protected] --role=roles/editor | |
# Cloud Build | |
gcloud projects add-iam-policy-binding $PROJECT --member=serviceAccount:[email protected] --role=roles/cloudbuild.builds.builder | |
# App Engine | |
gcloud projects add-iam-policy-binding $PROJECT --member=serviceAccount:[email protected] --role=roles/editor | |
gcloud projects add-iam-policy-binding $PROJECT --member=serviceAccount:service-$PROJECT_NUMBER@gae-api-prod.google.com.iam.gserviceaccount.com --role=roles/appengineflex.serviceAgent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment