Created
March 5, 2020 17:18
-
-
Save naviat/54e180fd122bcbb1889f4fad5e922eef to your computer and use it in GitHub Desktop.
FIX: Permission 'iam.serviceaccounts.actAs' denied on service account https://phpnews.io/feeditem/google-cloud-build-google-cloud-run-fixing-error-gcloud-run-deploy-permission-denied-the-caller-does-not-have-permission
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
# Config | |
GC_PROJECT=your-gcp-project-id | |
GC_PROJECT_NUMBER=your-gcp-project-number | |
# Grant the Cloud Run Admin role to the Cloud Build service account | |
gcloud projects add-iam-policy-binding $GC_PROJECT \ | |
--member "serviceAccount:$GC_PROJECT_NUMBER@cloudbuild.gserviceaccount.com" \ | |
--role roles/run.admin | |
# Grant the IAM Service Account User role to the Cloud Build service account on the Cloud Run runtime service account | |
gcloud iam service-accounts add-iam-policy-binding \ | |
$GC_PROJECT_NUMBER-compute@developer.gserviceaccount.com \ | |
--member="serviceAccount:$GC_PROJECT_NUMBER@cloudbuild.gserviceaccount.com" \ | |
--role="roles/iam.serviceAccountUser" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment