Skip to content

Commit

Permalink
fix: shallow copy of object in r/vpc_security_rule
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRieske committed Jul 17, 2024
1 parent e94b50a commit afc3071
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions internal/service/ec2/vpc_security_group_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down

0 comments on commit afc3071

Please sign in to comment.