From 694f4b2acacc87f5d1fb271c3f6e5f90eda474f0 Mon Sep 17 00:00:00 2001 From: Kunpei Sakai Date: Sat, 2 Mar 2019 01:03:59 +0900 Subject: [PATCH 1/5] add topic_link in outputs.tf With this change topic link of output will be compliant with the following format. projects/[PROJECT_ID]/topics/[TOPIC_ID] By this change, it will be more useful for combination with the following resources. - logging_project_sink - cloudiot_registry --- outputs.tf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/outputs.tf b/outputs.tf index c41ad88..ac32b6a 100644 --- a/outputs.tf +++ b/outputs.tf @@ -19,6 +19,11 @@ output "topic" { description = "The name of the Pub/Sub topic" } +output "topic_link" { + value = "${google_pubsub_topic.topic.id}" + description = "The URI of the Pub/Sub topic" +} + output "subscription_names" { value = "${concat( google_pubsub_subscription.push_subscriptions.*.name, From 826389f68cc7abbcc41df638111ddbf47830ce26 Mon Sep 17 00:00:00 2001 From: Aaron Lane Date: Sat, 9 Mar 2019 01:01:43 +0900 Subject: [PATCH 2/5] rename from topic_link to id Co-Authored-By: namusyaka --- outputs.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/outputs.tf b/outputs.tf index ac32b6a..16b4c6f 100644 --- a/outputs.tf +++ b/outputs.tf @@ -19,7 +19,7 @@ output "topic" { description = "The name of the Pub/Sub topic" } -output "topic_link" { +output "id" { value = "${google_pubsub_topic.topic.id}" description = "The URI of the Pub/Sub topic" } From eacfd53982259407ea387a982ddf58d16f78c481 Mon Sep 17 00:00:00 2001 From: Aaron Lane Date: Sat, 9 Mar 2019 01:02:03 +0900 Subject: [PATCH 3/5] URI -> ID Co-Authored-By: namusyaka --- outputs.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/outputs.tf b/outputs.tf index 16b4c6f..05aaa2b 100644 --- a/outputs.tf +++ b/outputs.tf @@ -21,7 +21,7 @@ output "topic" { output "id" { value = "${google_pubsub_topic.topic.id}" - description = "The URI of the Pub/Sub topic" + description = "The ID of the Pub/Sub topic" } output "subscription_names" { From db89a5c248c3bb621e0ee60a4714d20fe3fcb49e Mon Sep 17 00:00:00 2001 From: Kunpei Sakai Date: Sat, 9 Mar 2019 01:03:11 +0900 Subject: [PATCH 4/5] add uri as an output resource --- outputs.tf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/outputs.tf b/outputs.tf index 05aaa2b..649aea4 100644 --- a/outputs.tf +++ b/outputs.tf @@ -24,6 +24,11 @@ output "id" { description = "The ID of the Pub/Sub topic" } +output "uri" { + value = "pubsub.googleapis.com/${google_pubsub_topic.topic.id}" + description = "The URI of the Pub/Sub topic" +} + output "subscription_names" { value = "${concat( google_pubsub_subscription.push_subscriptions.*.name, From e880cb5a594df757fffff48c7386651b198df47e Mon Sep 17 00:00:00 2001 From: Kunpei Sakai Date: Sat, 9 Mar 2019 01:27:06 +0900 Subject: [PATCH 5/5] update README --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3b1c10a..917b202 100644 --- a/README.md +++ b/README.md @@ -43,9 +43,11 @@ module "pubsub" { | Name | Description | |------|-------------| +| id | The ID of the Pub/Sub topic | | subscription_names | The name list of Pub/Sub subscriptions | | subscription_paths | The path list of Pub/Sub subscriptions | | topic | The name of the Pub/Sub topic | +| uri | The URI of the Pub/Sub topic | [^]: (autogen_docs_end) @@ -155,4 +157,4 @@ are as follows: - Golang - gofmt. gofmt comes with the standard golang installation. golang -s a compiled language so there is no standard linter. - Terraform - terraform has a built-in linter in the `terraform validate` command. -- Dockerfiles - hadolint. Can be found in homebrew +- Dockerfiles - hadolint. Can be found in homebrew \ No newline at end of file