Skip to content

Commit

Permalink
feat: Use non-authoritative iam binding for subscription (#46)
Browse files Browse the repository at this point in the history
Fixes #44
  • Loading branch information
tpolekhin authored Nov 13, 2020
1 parent 112607c commit b8390bd
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -54,27 +54,23 @@ resource "google_pubsub_topic_iam_member" "pull_topic_binding" {
]
}

resource "google_pubsub_subscription_iam_binding" "pull_subscription_binding" {
resource "google_pubsub_subscription_iam_member" "pull_subscription_binding" {
count = var.create_topic ? length(var.pull_subscriptions) : 0
project = var.project_id
subscription = var.pull_subscriptions[count.index].name
role = "roles/pubsub.subscriber"
members = [
"serviceAccount:${local.pubsub_svc_account_email}",
]
member = "serviceAccount:${local.pubsub_svc_account_email}"
depends_on = [
google_pubsub_subscription.pull_subscriptions,
]
}

resource "google_pubsub_subscription_iam_binding" "push_subscription_binding" {
resource "google_pubsub_subscription_iam_member" "push_subscription_binding" {
count = var.create_topic ? length(var.push_subscriptions) : 0
project = var.project_id
subscription = var.push_subscriptions[count.index].name
role = "roles/pubsub.subscriber"
members = [
"serviceAccount:${local.pubsub_svc_account_email}",
]
member = "serviceAccount:${local.pubsub_svc_account_email}"
depends_on = [
google_pubsub_subscription.push_subscriptions,
]
Expand Down

0 comments on commit b8390bd

Please sign in to comment.