File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,15 +47,11 @@ resource "google_cloudfunctions2_function" "function" {
4747 event_trigger {
4848 trigger_region = " us-central1"
4949 event_type = " google.cloud.pubsub.topic.v1.messagePublished"
50- pubsub_topic = google_pubsub_topic . topic . id
50+ pubsub_topic = module . pubsub . info . request_topic . topic_id
5151 retry_policy = " RETRY_POLICY_RETRY"
5252 }
5353}
5454
55- resource "google_pubsub_topic" "topic" {
56- name = " cloudfunctions-push-topic-${ terraform . workspace } "
57- }
58-
5955resource "google_storage_bucket" "bucket" {
6056 name = " ${ terraform . workspace } -gcf-source" # Every bucket name must be globally unique
6157 location = " US"
@@ -88,13 +84,6 @@ variable "functionsource" {
8884}
8985
9086output "pubsub_info" {
91- value = {
92- request_topic = {
93- topic_name = google_pubsub_topic.topic.name
94- subscription_name = " n/a" # subscription name is not required for cloud functions
95- }
96-
97- response_topic = module.pubsub.info.response_topic
98- }
87+ value = module. pubsub . info
9988 description = " Info about the request/response pubsub topics and subscription to use in the test"
10089}
Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ output "info" {
8989 value = {
9090 request_topic = {
9191 topic_name = google_pubsub_topic.request.name
92+ topic_id = google_pubsub_topic.request.id
9293 subscription_name = google_pubsub_subscription.request_subscription.name
9394 }
9495
You can’t perform that action at this time.
0 commit comments