Skip to main content

Module: msk-apache-kafka-cluster

Terraform module to provision Amazon Managed Streaming for Apache Kafka

Note: this module is intended for use with an existing VPC. To create a new VPC, use terraform-aws-vpc module.

NOTE: Release 0.8.0 contains breaking changes that will result in the destruction of your existing MSK cluster. To preserve the original cluster, follow the instructions in the 0.7.x to 0.8.x+ migration path.

Usage

Here's how to invoke this example module in your projects

module "kafka" {
source = "cloudposse/msk-apache-kafka-cluster/aws"
# Cloud Posse recommends pinning every module to a specific version
# version = "x.x.x"

kafka_version = "3.3.2"
namespace = "eg"
stage = "prod"
name = "app"
vpc_id = "vpc-XXXXXXXX"
subnet_ids = ["subnet-XXXXXXXXX", "subnet-YYYYYYYY"]
broker_per_zone = 2
broker_instance_type = "kafka.m5.large"

# A list of IDs of Security Groups to associate the created resource with, in addition to the created security group
associated_security_group_ids = ["sg-XXXXXXXXX", "sg-YYYYYYYY"]

# A list of IDs of Security Groups to allow access to the cluster
allowed_security_group_ids = ["sg-XXXXXXXXX", "sg-YYYYYYYY"]
}

Examples

Here is an example of using this module: