Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 684 Bytes

msk_app_topics.md

File metadata and controls

36 lines (26 loc) · 684 Bytes

msk_app_topics

Requires that any consume_topics or produce_topics contain only topics that are defined in the current module.

Example

Bad examples

resource "kafka_topic" "pubsub_examples" {
  name = "pubsub.examples"
}

module "consumer" {
  # bad: "some-team.some.topic.v1" not defined in this module
  consume_topics = ["some-team.some.topic.v1"]
}

Good example

resource "kafka_topic" "pubsub_examples" {
  name = "pubsub.examples"
}


module "consumer" {
  # good: topic is in this module
  consume_topics = [kafka_topic.pubsub_examples.name]

  # good: also fine if you use the name directly
  produce_topics = "pubsub.examples"
}