diff --git a/outputs.tf b/outputs.tf index 5dfd865..ba44ff5 100644 --- a/outputs.tf +++ b/outputs.tf @@ -15,22 +15,22 @@ */ output "topic" { - value = google_pubsub_topic.topic.0.name + value = length(google_pubsub_topic.topic) > 0 ? google_pubsub_topic.topic.0.name : "" description = "The name of the Pub/Sub topic" } output "topic_labels" { - value = google_pubsub_topic.topic.0.labels + value = length(google_pubsub_topic.topic) > 0 ? google_pubsub_topic.topic.0.labels : {} description = "Labels assigned to the Pub/Sub topic" } output "id" { - value = google_pubsub_topic.topic.0.id + value = length(google_pubsub_topic.topic) > 0 ? google_pubsub_topic.topic.0.id : "" description = "The ID of the Pub/Sub topic" } output "uri" { - value = "pubsub.googleapis.com/${google_pubsub_topic.topic.0.id}" + value = length(google_pubsub_topic.topic) > 0 ? "pubsub.googleapis.com/${google_pubsub_topic.topic.0.id}" : "" description = "The URI of the Pub/Sub topic" }