diff --git a/patches/0022-Fix-elbv2-target-group-read.patch b/patches/0022-Fix-elbv2-target-group-read.patch index dc196252d8e..60a4973e9ef 100644 --- a/patches/0022-Fix-elbv2-target-group-read.patch +++ b/patches/0022-Fix-elbv2-target-group-read.patch @@ -1,25 +1,43 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Daniel Bradley -Date: Fri, 12 May 2023 10:55:42 +0100 -Subject: [PATCH 22/36] Fix elbv2 target group read +From: Anton Tayanovskyy +Date: Fri, 19 Jan 2024 17:36:47 -0500 +Subject: [PATCH 40/40] Fix elbv2 target group read to workaround #2517 -Workaround for https://github.com/pulumi/pulumi-aws/issues/2517 -Don't return single empty map. Return empty list instead. diff --git a/internal/service/elbv2/target_group.go b/internal/service/elbv2/target_group.go -index da35f69df6..d5f04f4647 100644 +index 388edc5ec7..e61259bfa2 100644 --- a/internal/service/elbv2/target_group.go +++ b/internal/service/elbv2/target_group.go -@@ -1221,6 +1221,12 @@ func flattenTargetGroupFailover(attributes []*elbv2.TargetGroupAttribute) []inte - } +@@ -562,15 +562,15 @@ func resourceTargetGroupRead(ctx context.Context, d *schema.ResourceData, meta i + return sdkdiag.AppendErrorf(diags, "reading ELBv2 Target Group (%s) attributes: %s", d.Id(), err) + } + +- if err := d.Set("stickiness", []interface{}{flattenTargetGroupStickinessAttributes(attributes, protocol)}); err != nil { ++ if err := d.Set("stickiness", fix2517(flattenTargetGroupStickinessAttributes(attributes, protocol))); err != nil { + return sdkdiag.AppendErrorf(diags, "setting stickiness: %s", err) + } + +- if err := d.Set("target_failover", []interface{}{flattenTargetGroupTargetFailoverAttributes(attributes, protocol)}); err != nil { ++ if err := d.Set("target_failover", fix2517(flattenTargetGroupTargetFailoverAttributes(attributes, protocol))); err != nil { + return sdkdiag.AppendErrorf(diags, "setting target_failover: %s", err) + } + +- if err := d.Set("target_health_state", []interface{}{flattenTargetGroupTargetHealthStateAttributes(attributes, protocol)}); err != nil { ++ if err := d.Set("target_health_state", fix2517(flattenTargetGroupTargetHealthStateAttributes(attributes, protocol))); err != nil { + return sdkdiag.AppendErrorf(diags, "setting target_health_state: %s", err) } -+ // Workaround for https://github.com/pulumi/pulumi-aws/issues/2517 -+ // Don't return single empty map. Return empty list instead. +@@ -1385,3 +1385,13 @@ func runtimeValidations(d *schema.ResourceData, diags *diag.Diagnostics) { + } + } + } ++ ++// Workaround for https://github.com/pulumi/pulumi-aws/issues/2517 ++// ++// Don't return single empty map. Return empty list instead. ++func fix2517(m map[string]interface{}) []interface{} { + if len(m) == 0 { + return []interface{}{} + } -+ - return []interface{}{m} - } - ++ return []interface{}{m} ++} diff --git a/upstream b/upstream index 399ec5d6236..0fc337f1416 160000 --- a/upstream +++ b/upstream @@ -1 +1 @@ -Subproject commit 399ec5d623675592ac4924d733c198d4a65f82e3 +Subproject commit 0fc337f141613f92c820746a78d3bce89388d821