Skip to content

Commit

Permalink
expose x-goog-version instead of attributes argument
Browse files Browse the repository at this point in the history
  • Loading branch information
namusyaka committed Oct 26, 2018
1 parent 442ebbe commit 039a43c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module "pubsub" {
name = "push" // required
ack_deadline_seconds = 20 // optonal
push_endpoint = "https://example.com"
attributes = "x-goog-version:v1beta1"
x-goog-version = "v1beta1"
}
]
pull_subscriptions = [
Expand Down
2 changes: 1 addition & 1 deletion examples/simple/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module "pubsub" {
name = "push"
ack_deadline_seconds = 20
push_endpoint = "https://${var.project_id}.appspot.com"
attributes = "x-goog-version:v1beta1"
x-goog-version = "v1beta1"
},
]
}
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ resource "google_pubsub_subscription" "push_subscriptions" {
// FIXME: This should be programmable, but nested map isn't supported at this time.
// https://github.com/hashicorp/terraform/issues/2114
attributes = {
x-goog-version = "${element(split(":", lookup(var.push_subscriptions[count.index], "attributes", "x-goog-version:v1")), 1)}"
x-goog-version = "${lookup(var.push_subscriptions[count.index], "x-goog-version", "v1")}"
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module "pubsub" {
{
name = "push"
push_endpoint = "https://${var.project}.appspot.com/"
attributes = "x-goog-version:v1beta1"
x-goog-version = "v1beta1"
ack_deadline_seconds = 20
},
]
Expand Down

0 comments on commit 039a43c

Please sign in to comment.