Skip to content

Commit 5f4ee01

Browse files
committed
Fix same name error when recreating aws_msk_configuration
1 parent d5b6c95 commit 5f4ee01

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

main.tf

+7-2
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,11 @@ 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+
server_properties = join("\n", [for k, v in var.configuration_server_properties : format("%s = %s", k, v)])
256+
}
257+
253258
byte_length = 8
254259
}
255260

@@ -258,8 +263,8 @@ resource "aws_msk_configuration" "this" {
258263

259264
name = format("%s-%s", coalesce(var.configuration_name, var.name), random_id.this[0].dec)
260265
description = var.configuration_description
261-
kafka_versions = [var.kafka_version]
262-
server_properties = join("\n", [for k, v in var.configuration_server_properties : format("%s = %s", k, v)])
266+
kafka_versions = [random_id.this[0].keepers.kafka_version]
267+
server_properties = random_id.this[0].keepers.server_properties
263268

264269
lifecycle {
265270
create_before_destroy = true

0 commit comments

Comments
 (0)