From afc30710a758731e5976883700c7d7ab8b1650ef Mon Sep 17 00:00:00 2001 From: Daniel Rieske Date: Wed, 17 Jul 2024 15:11:07 +0200 Subject: [PATCH] fix: shallow copy of object in r/vpc_security_rule --- internal/service/ec2/vpc_security_group_rule.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/internal/service/ec2/vpc_security_group_rule.go b/internal/service/ec2/vpc_security_group_rule.go index d41c0adb2dc..d4721326b25 100644 --- a/internal/service/ec2/vpc_security_group_rule.go +++ b/internal/service/ec2/vpc_security_group_rule.go @@ -820,21 +820,20 @@ func expandIPPermission(d *schema.ResourceData, sg *awstypes.SecurityGroup) awst if v, ok := d.GetOk(names.AttrDescription); ok { description := v.(string) - - for _, v := range apiObject.IpRanges { - v.Description = aws.String(description) + for i := range apiObject.IpRanges { + apiObject.IpRanges[i].Description = aws.String(description) } - for _, v := range apiObject.Ipv6Ranges { - v.Description = aws.String(description) + for i := range apiObject.Ipv6Ranges { + apiObject.Ipv6Ranges[i].Description = aws.String(description) } - for _, v := range apiObject.PrefixListIds { - v.Description = aws.String(description) + for i := range apiObject.PrefixListIds { + apiObject.PrefixListIds[i].Description = aws.String(description) } - for _, v := range apiObject.UserIdGroupPairs { - v.Description = aws.String(description) + for i := range apiObject.UserIdGroupPairs { + apiObject.UserIdGroupPairs[i].Description = aws.String(description) } }