This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "vault" { | |
for_each = toset(var.namespaces) | |
alias = each.key | |
namespace = each.key | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "segment" { | |
default = { | |
"one" = "30000" | |
} | |
} | |
variable "cleanup" { | |
default = { | |
"one" = "delete" | |
"two" = "compact, delete" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "topics" { | |
default = ["one", "two", "three"] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "kafka_topic" "kafka_topic" { | |
for_each = toset(var.topic_name) | |
name = each.key | |
replication_factor = 1 | |
partitions = 3 | |
config = { | |
"segment.ms" = "20000" | |
"cleanup.policy" = "compact" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Referred from https://registry.terraform.io/providers/Mongey/kafka/latest/docs/resources/topic#argument-reference | |
resource "kafka_topic" "logs" { | |
name = "systemd_logs" | |
replication_factor = 2 | |
partitions = 100 | |
config = { | |
"segment.ms" = "20000" | |
"cleanup.policy" = "compact" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Referred from https://registry.terraform.io/providers/Mongey/kafka/latest/docs/resources/topic#argument-reference | |
provider "kafka" { | |
bootstrap_servers = ["localhost:9092"] | |
} | |
resource "kafka_topic" "logs" { | |
name = "systemd_logs" | |
replication_factor = 2 | |
partitions = 3 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
topic one: | |
segment.ms: "OneSegment" | |
cleanup.policy: "OneCleanup" | |
topic two: | |
segment.ms: "TwoSegment" | |
cleanup.policy: "TwoCleanup" | |
topic three: | |
default configuration |