Skip to content

Commit

Permalink
fix: ConflictException: A resource with this name already exists
Browse files Browse the repository at this point in the history
Error occurs when trying to upgrade kafka_version.
  • Loading branch information
the-middle committed Sep 10, 2024
1 parent d5b6c95 commit b597cd9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@ data "aws_iam_policy_document" "this" {
resource "random_id" "this" {
count = var.create && var.create_configuration ? 1 : 0

keepers = {
kafka_version = var.kafka_version
}

byte_length = 8
}

Expand All @@ -258,7 +262,7 @@ 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]
kafka_versions = [random_id.this[0].keepers.kafka_version]
server_properties = join("\n", [for k, v in var.configuration_server_properties : format("%s = %s", k, v)])

lifecycle {
Expand Down

0 comments on commit b597cd9

Please sign in to comment.