Giter Club home page Giter Club logo

terraform-yandex-kafka's Introduction

Yandex.Cloud Terraform Kafka Cluster module

Example

module "kafka" {
  source             = "github.com/darzanebor/terraform-yandex-kafka.git"
  name               = "default"
  environment        = "PRODUCTION"
  network_id         = "my-network-id"
  subnet_ids         = ["my-subnet-id-a",]

  vpc_security_groups = []
  create_default_security_group = true

  config = {
      version       = "2.8"
      brokers_count = 1
      zones         = ["ru-central1-a",]
      assign_public_ip = false
      unmanaged_topics = false
      schema_registry  = false

      resources = {
        resource_preset_id = "s2.medium"
        disk_type_id = "network-ssd"
        disk_size    = 128
      }

      kafka_config = {
          compression_type                = "COMPRESSION_TYPE_ZSTD"
          log_flush_interval_messages     = 1024
          log_flush_interval_ms           = 1000
          log_flush_scheduler_interval_ms = 1000
          log_retention_bytes             = 1073741824
          log_retention_hours             = 168
          log_retention_minutes           = 10080
          log_retention_ms                = 86400000
          log_segment_bytes               = 134217728
          log_preallocate                 = false
          num_partitions                  = 10
          default_replication_factor      = 1
          auto_create_topics_enable       = false
      }

      zookeeper = {
          resource_preset_id = "s2.micro"
          disk_type_id = "network-ssd"
          disk_size = 20
      }
  }
  users = [
    {
      name     = "producer-application"
      password = "password"
      permissions = [
        {
          topic_name = "input"
          role = "ACCESS_ROLE_PRODUCER"
        },
        {
          topic_name = "output"
          role = "ACCESS_ROLE_PRODUCER"
        },
      ]
    },
    {
      name     = "producer-consumer"
      password = "password"
      permissions = [
        {
          topic_name = "input"
          role = "ACCESS_ROLE_PRODUCER"
        }
      ]
    },
  ]
  topics = [{
      name               = "input"
      partitions         = 4
      replication_factor = 1
      config = {
        cleanup_policy        = "CLEANUP_POLICY_COMPACT"
        compression_type      = "COMPRESSION_TYPE_LZ4"
        delete_retention_ms   = 86400000
        file_delete_delay_ms  = 60000
        flush_messages        = 128
        flush_ms              = 1000
        min_compaction_lag_ms = 0
        retention_bytes       = 10737418240
        retention_ms          = 604800000
        max_message_bytes     = 1048588
        min_insync_replicas   = 1
        segment_bytes         = 268435456
        preallocate           = false  
      }
  },
  {
    name               = "output"
    partitions         = 4
    replication_factor = 1
  }]

  default_security_group_ingress = [
    {
      protocol       = "TCP"
      description    = "Allow All ingress."
      v4_cidr_blocks = ["0.0.0.0/0"]
      port           = -1
    },
  ]

  default_security_group_egress = [
    {
      protocol       = "ANY"
      description    = "Allow All egress."
      v4_cidr_blocks = ["0.0.0.0/0"]
      from_port      = -1
      to_port        = -1
    },
  ]
}

Requirements

Name Version
yandex >= 0.13

Providers

Name Version
yandex >= 0.13

Modules

No modules.

Resources

Name Type
yandex_mdb_kafka_cluster.this resource
yandex_mdb_kafka_topic.this resource
yandex_vpc_security_group.this resource

Inputs

Name Description Type Default Required
config (Required) Configuration of the Kafka cluster. The structure is documented below. map {} no
create_default_security_group (Optional) - Create default security group. bool false no
default_security_group_egress (Optional) - A list of egress rules to create with default security group. list [] no
default_security_group_ingress (Optional) - A list of ingress rules to create with default security group. list [] no
environment (Optional) Deployment environment of the Kafka cluster. Can be either PRESTABLE or PRODUCTION. string "PRODUCTION" no
name (Required) Cluster name. any n/a yes
network_id (Required) ID of the network, to which the Kafka cluster belongs. any n/a yes
subnet_ids (Optional) IDs of the subnets, to which the Kafka cluster belongs. any null no
topics (Optional) Kafka topics to create with configuration. list [] no
users (Optional) A user of the Kafka cluster. list [] no
vpc_security_groups (Optional) - Assign security groups to instance. list [] no

Outputs

Name Description
yandex_mdb_kafka_cluster n/a
yandex_mdb_kafka_topic n/a

terraform-yandex-kafka's People

Contributors

darzanebor avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.