Skip to content

Commit 4f31418

Browse files
feat: Allow MSK configuration changes on running clusters (#17)
Co-authored-by: Bryant Biggs <[email protected]>
1 parent d7b2b2e commit 4f31418

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module "msk_kafka_cluster" {
1313
source = "terraform-aws-modules/msk-kafka-cluster/aws"
1414
1515
name = local.name
16-
kafka_version = "3.4.0"
16+
kafka_version = "3.5.1"
1717
number_of_broker_nodes = 3
1818
enhanced_monitoring = "PER_TOPIC_PER_PARTITION"
1919
@@ -129,12 +129,14 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module
129129
|------|---------|
130130
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
131131
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.21 |
132+
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 3.6 |
132133

133134
## Providers
134135

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

139141
## Modules
140142

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

161164
## Inputs

main.tf

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,13 +247,23 @@ data "aws_iam_policy_document" "this" {
247247
# Configuration
248248
################################################################################
249249

250+
resource "random_id" "this" {
251+
count = var.create && var.create_configuration ? 1 : 0
252+
253+
byte_length = 8
254+
}
255+
250256
resource "aws_msk_configuration" "this" {
251257
count = var.create && var.create_configuration ? 1 : 0
252258

253-
name = coalesce(var.configuration_name, var.name)
259+
name = format("%s-%s", coalesce(var.configuration_name, var.name), random_id.this[0].dec)
254260
description = var.configuration_description
255261
kafka_versions = [var.kafka_version]
256262
server_properties = join("\n", [for k, v in var.configuration_server_properties : format("%s = %s", k, v)])
263+
264+
lifecycle {
265+
create_before_destroy = true
266+
}
257267
}
258268

259269
################################################################################

versions.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,9 @@ terraform {
66
source = "hashicorp/aws"
77
version = ">= 5.21"
88
}
9+
random = {
10+
source = "hashicorp/random"
11+
version = ">= 3.6"
12+
}
913
}
1014
}

0 commit comments

Comments
 (0)