Skip to content

Commit d5b4e6c

Browse files
authored
feat: Create a new configuration when the Kafka version is changed to avoid ConflictException: A resource with this name already exists errors (#40)
1 parent d5b6c95 commit d5b4e6c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

main.tf

+5-1
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,10 @@ data "aws_iam_policy_document" "this" {
250250
resource "random_id" "this" {
251251
count = var.create && var.create_configuration ? 1 : 0
252252

253+
keepers = {
254+
kafka_version = var.kafka_version
255+
}
256+
253257
byte_length = 8
254258
}
255259

@@ -258,7 +262,7 @@ resource "aws_msk_configuration" "this" {
258262

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

264268
lifecycle {

0 commit comments

Comments
 (0)