Skip to content

Commit

Permalink
feat: Allow MSK configuration changes on running clusters (#17)
Browse files Browse the repository at this point in the history
Co-authored-by: Bryant Biggs <[email protected]>
  • Loading branch information
GreggSchofield and bryantbiggs authored Mar 18, 2024
1 parent d7b2b2e commit 4f31418
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module "msk_kafka_cluster" {
source = "terraform-aws-modules/msk-kafka-cluster/aws"
name = local.name
kafka_version = "3.4.0"
kafka_version = "3.5.1"
number_of_broker_nodes = 3
enhanced_monitoring = "PER_TOPIC_PER_PARTITION"
Expand Down Expand Up @@ -129,12 +129,14 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.21 |
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 3.6 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.21 |
| <a name="provider_random"></a> [random](#provider\_random) | >= 3.6 |

## Modules

Expand All @@ -156,6 +158,7 @@ No modules.
| [aws_msk_vpc_connection.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/msk_vpc_connection) | resource |
| [aws_mskconnect_custom_plugin.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/mskconnect_custom_plugin) | resource |
| [aws_mskconnect_worker_configuration.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/mskconnect_worker_configuration) | resource |
| [random_id.this](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/id) | resource |
| [aws_iam_policy_document.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |

## Inputs
Expand Down
12 changes: 11 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,23 @@ data "aws_iam_policy_document" "this" {
# Configuration
################################################################################

resource "random_id" "this" {
count = var.create && var.create_configuration ? 1 : 0

byte_length = 8
}

resource "aws_msk_configuration" "this" {
count = var.create && var.create_configuration ? 1 : 0

name = coalesce(var.configuration_name, var.name)
name = format("%s-%s", coalesce(var.configuration_name, var.name), random_id.this[0].dec)
description = var.configuration_description
kafka_versions = [var.kafka_version]
server_properties = join("\n", [for k, v in var.configuration_server_properties : format("%s = %s", k, v)])

lifecycle {
create_before_destroy = true
}
}

################################################################################
Expand Down
4 changes: 4 additions & 0 deletions versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ terraform {
source = "hashicorp/aws"
version = ">= 5.21"
}
random = {
source = "hashicorp/random"
version = ">= 3.6"
}
}
}

0 comments on commit 4f31418

Please sign in to comment.