From c86f8d4db3236e7dae59ef9142da4d7e496138c8 Mon Sep 17 00:00:00 2001 From: Roberto Devesa <15369573+Roberdvs@users.noreply.github.com> Date: Thu, 27 Jul 2023 13:58:01 +0200 Subject: [PATCH] fix: Use `coalesce` when desired default value is not `null` (#2696) Co-authored-by: Bryant Biggs --- main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.tf b/main.tf index 52d36aa201..ca0390ab7b 100644 --- a/main.tf +++ b/main.tf @@ -386,7 +386,7 @@ resource "aws_eks_addon" "this" { cluster_name = aws_eks_cluster.this[0].name addon_name = try(each.value.name, each.key) - addon_version = try(each.value.addon_version, data.aws_eks_addon_version.this[each.key].version) + addon_version = coalesce(try(each.value.addon_version, null), data.aws_eks_addon_version.this[each.key].version) configuration_values = try(each.value.configuration_values, null) preserve = try(each.value.preserve, null) resolve_conflicts = try(each.value.resolve_conflicts, "OVERWRITE") @@ -414,7 +414,7 @@ resource "aws_eks_addon" "before_compute" { cluster_name = aws_eks_cluster.this[0].name addon_name = try(each.value.name, each.key) - addon_version = try(each.value.addon_version, data.aws_eks_addon_version.this[each.key].version) + addon_version = coalesce(try(each.value.addon_version, null), data.aws_eks_addon_version.this[each.key].version) configuration_values = try(each.value.configuration_values, null) preserve = try(each.value.preserve, null) resolve_conflicts = try(each.value.resolve_conflicts, "OVERWRITE")