https://github.com/geekcell/terraform-aws-msk-cluster
Terraform module to provision an AWS MSK Cluster.
https://github.com/geekcell/terraform-aws-msk-cluster
aws kafka msk msk-cluster terraform terraform-module
Last synced: 3 months ago
JSON representation
Terraform module to provision an AWS MSK Cluster.
- Host: GitHub
- URL: https://github.com/geekcell/terraform-aws-msk-cluster
- Owner: geekcell
- License: apache-2.0
- Created: 2023-02-07T09:10:48.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-28T13:04:24.000Z (almost 2 years ago)
- Last Synced: 2025-03-01T18:48:52.259Z (3 months ago)
- Topics: aws, kafka, msk, msk-cluster, terraform, terraform-module
- Language: HCL
- Homepage: https://www.geekcell.io
- Size: 33.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.geekcell.io/)
### Code Quality
[](https://github.com/geekcell/terraform-aws-msk-cluster/blob/master/LICENSE)
[](https://github.com/geekcell/terraform-aws-msk-cluster/releases)
[](https://github.com/geekcell/terraform-aws-msk-cluster/actions/workflows/release.yaml)
[](https://github.com/geekcell/terraform-aws-msk-cluster/actions/workflows/validate.yaml)
[](https://github.com/geekcell/terraform-aws-msk-cluster/actions/workflows/linter.yaml)# Terraform AWS MSK Cluster Module
Terraform module which creates a MSK Cluster. The focus on this module lies within it's simplicity by providing
default values that should make sense for most use cases.## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [client\_subnets](#input\_client\_subnets) | A list of subnets to connect to in client VPC. | `list(string)` | n/a | yes |
| [cluster\_name](#input\_cluster\_name) | Name of the MSK cluster. | `string` | n/a | yes |
| [enable\_appautoscaling](#input\_enable\_appautoscaling) | Enable or disable MSK App Autoscaling. | `bool` | `false` | no |
| [instance\_type](#input\_instance\_type) | Specify the instance type to use for the kafka brokers. | `string` | n/a | yes |
| [kafka\_version](#input\_kafka\_version) | Specify the desired Kafka software version. | `string` | n/a | yes |
| [number\_of\_broker\_nodes](#input\_number\_of\_broker\_nodes) | The desired total number of broker nodes in the kafka cluster. | `number` | `3` | no |
| [security\_groups](#input\_security\_groups) | A list of the security groups to associate with the elastic network interfaces to control who can communicate with the cluster. | `list(string)` | n/a | yes |
| [tags](#input\_tags) | Tags to add to the AWS Customer Managed Key. | `map(any)` | `{}` | no |
| [volume\_size](#input\_volume\_size) | The size in GiB of the EBS volume for the data drive on each broker node. | `number` | n/a | yes |## Outputs
| Name | Description |
|------|-------------|
| [bootstrap\_brokers\_tls](#output\_bootstrap\_brokers\_tls) | One or more DNS names (or IP addresses) and TLS port pairs. |
| [zookeeper\_connect\_string](#output\_zookeeper\_connect\_string) | A comma separated list of one or more hostname:port pairs to use to connect to the Apache Zookeeper cluster. |## Providers
| Name | Version |
|------|---------|
| [aws](#provider\_aws) | >= 4.4 |## Resources
- resource.aws_msk_cluster.main (main.tf#7)
# Examples
### Basic Example
```hcl
module "basic-example" {
source = "../../"
client_subnets = ["subnet-12345678", "subnet-87654321"]
cluster_name = "cluster1"
instance_type = "kafka.t3.small"
kafka_version = "3.2.0"
security_groups = ["sg-12345678"]
volume_size = 10
}
```
### With Autoscaling
```hcl
module "with-autoscaling" {
source = "../../"
client_subnets = ["subnet-12345678", "subnet-87654321"]
cluster_name = "cluster1"
instance_type = "kafka.t3.small"
kafka_version = "3.2.0"
security_groups = ["sg-12345678"]
volume_size = 10enable_appautoscaling = true
}
```