Skip to content

Commit

Permalink
Fix same name error when recreating aws_msk_configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
the-middle committed Sep 10, 2024
1 parent d5b6c95 commit fddac80
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,11 @@ data "aws_iam_policy_document" "this" {
resource "random_id" "this" {
count = var.create && var.create_configuration ? 1 : 0

keepers = {
kafka_version = var.kafka_version
server_properties = join("\n", [for k, v in var.configuration_server_properties : format("%s = %s", k, v)])
}

byte_length = 8
}

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

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)])
kafka_versions = [random_id.this[0].keepers.kafka_version]
server_properties = random_id.this[0].keepers.server_properties

lifecycle {
create_before_destroy = true
Expand Down

0 comments on commit fddac80

Please sign in to comment.