Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gautamr/1301e895aa681895ba6fd6938e73eaf3 to your computer and use it in GitHub Desktop.
Save gautamr/1301e895aa681895ba6fd6938e73eaf3 to your computer and use it in GitHub Desktop.
Restore default GCP service accounts
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