Skip to content

Instantly share code, notes, and snippets.

View nishadmehendale's full-sized avatar
🎯
Focusing

Nishad Mehendale nishadmehendale

🎯
Focusing
View GitHub Profile
@nishadmehendale
nishadmehendale / dynamic_providers.tf
Last active January 27, 2022 14:39
Dynamic Provider Creation Script
provider "vault" {
for_each = toset(var.namespaces)
alias = each.key
namespace = each.key
}
@nishadmehendale
nishadmehendale / kafka_topic_configuration_maps.tf
Created January 23, 2022 10:06
Kafka Topic Configuration Maps
variable "segment" {
default = {
"one" = "30000"
}
}
variable "cleanup" {
default = {
"one" = "delete"
"two" = "compact, delete"
@nishadmehendale
nishadmehendale / topics.tf
Created January 23, 2022 09:55
list of topics
variable "topics" {
default = ["one", "two", "three"]
}
@nishadmehendale
nishadmehendale / sample_kafka_topic_with_for_each.tf
Created January 23, 2022 09:53
Sample Kafka Topic Creation script with for each implementation
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"
}
}
@nishadmehendale
nishadmehendale / sample_kafka_topic.tf
Last active January 23, 2022 08:27
Sample Kafka Topic Script With Configuration
# 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"
}
@nishadmehendale
nishadmehendale / existing_module.tf
Created January 23, 2022 08:21
Existing Kafka Topic Creation Script
# 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
}
@nishadmehendale
nishadmehendale / topics.txt
Created January 23, 2022 08:05
List of topics and their configuration
topic one:
segment.ms: "OneSegment"
cleanup.policy: "OneCleanup"
topic two:
segment.ms: "TwoSegment"
cleanup.policy: "TwoCleanup"
topic three:
default configuration