Created
August 26, 2019 02:07
-
-
Save jonbcampos/1e995934cd5422c88a8ef196ce944c50 to your computer and use it in GitHub Desktop.
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
echo "create iam binding" | |
gcloud projects add-iam-policy-binding ${GCLOUD_PROJECT} \ | |
--member=serviceAccount:service-${PROJECT_NUMBER}@gcp-sa-pubsub.iam.gserviceaccount.com \ | |
--role=roles/iam.serviceAccountTokenCreator | |
echo "create service account" | |
gcloud iam service-accounts create ${INVOKER_NAME} \ | |
--display-name "Cloud Run Pub/Sub Invoker" | |
echo "iam roles" | |
gcloud beta run services add-iam-policy-binding ${PROJECT_NAME} \ | |
--member=serviceAccount:${INVOKER_NAME}@${GCLOUD_PROJECT}.iam.gserviceaccount.com \ | |
--role=roles/run.invoker | |
echo "create subscription" | |
gcloud beta pubsub subscriptions create ${SUBSCRIPTION_NAME} \ | |
--topic ${TOPIC_NAME} \ | |
--push-endpoint=${SERVICE_URL} \ | |
--push-auth-service-account=${INVOKER_NAME}@${GCLOUD_PROJECT}.iam.gserviceaccount.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment