Skip to content

Commit

Permalink
feat: Add OIDC token support (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
anakovt authored Jul 20, 2020
1 parent 5703141 commit f64f8d1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ module "pubsub" {
ack_deadline_seconds = 20 // optional
push_endpoint = "https://example.com" // required
x-goog-version = "v1beta1" // optional
oidc_service_account = "[email protected]" // optional
audience = "example" // optional
expiration_policy = "1209600s" // optional
}
]
Expand Down
9 changes: 8 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,15 @@ resource "google_pubsub_subscription" "push_subscriptions" {
attributes = {
x-goog-version = lookup(var.push_subscriptions[count.index], "x-goog-version", "v1")
}
}

dynamic "oidc_token" {
for_each = (lookup(var.push_subscriptions[count.index], "oidc_service_account_email", "") != "") ? [true] : []
content {
service_account_email = lookup(var.push_subscriptions[count.index], "oidc_service_account_email", "")
audience = lookup(var.push_subscriptions[count.index], "audience", "")
}
}
}
depends_on = [google_pubsub_topic.topic]
}

Expand Down

0 comments on commit f64f8d1

Please sign in to comment.