Skip to content

Commit

Permalink
Fix issue with GKE cluster notifications topic, change pubsub module …
Browse files Browse the repository at this point in the history
…output to static.
  • Loading branch information
rosmo committed Mar 2, 2023
1 parent a5fd32e commit fb64054
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions modules/gke-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,10 @@ resource "google_compute_network_peering_routes_config" "gke_master" {

resource "google_pubsub_topic" "notifications" {
count = (
try(var.enable_features.upgrade_notifications.topic_id, null) == null ? 0 : 1
try(var.enable_features.upgrade_notifications.topic_id, null) == null ? 1 : 0
)
name = "gke-pubsub-notifications"
project = var.project_id
name = "gke-pubsub-notifications"
labels = {
content = "gke-notifications"
}
Expand Down
1 change: 1 addition & 0 deletions modules/pubsub/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ locals {
options = try(v.options, v, null) == null ? var.defaults : v.options
}
}
topic_id_static = "projects/${var.project_id}/topics/${var.name}"
}

resource "google_pubsub_schema" "default" {
Expand Down
3 changes: 2 additions & 1 deletion modules/pubsub/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@

output "id" {
description = "Topic id."
value = google_pubsub_topic.default.id
value = local.topic_id_static
depends_on = [
google_pubsub_topic.default,
google_pubsub_topic_iam_binding.default
]
}
Expand Down

0 comments on commit fb64054

Please sign in to comment.