mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
provider/aws: Fix issue in Classic env with external Security Groups
Linking a security group from another account requires setting the UserID, which we were stripping out
This commit is contained in:
parent
b4c1c223ff
commit
cc79e6cb8d
@ -157,12 +157,15 @@ func expandIPPerms(
|
|||||||
|
|
||||||
perm.UserIDGroupPairs[i] = &ec2.UserIDGroupPair{
|
perm.UserIDGroupPairs[i] = &ec2.UserIDGroupPair{
|
||||||
GroupID: aws.String(id),
|
GroupID: aws.String(id),
|
||||||
UserID: aws.String(ownerId),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ownerId != "" {
|
||||||
|
perm.UserIDGroupPairs[i].UserID = aws.String(ownerId)
|
||||||
|
}
|
||||||
|
|
||||||
if !vpc {
|
if !vpc {
|
||||||
perm.UserIDGroupPairs[i].GroupID = nil
|
perm.UserIDGroupPairs[i].GroupID = nil
|
||||||
perm.UserIDGroupPairs[i].GroupName = aws.String(id)
|
perm.UserIDGroupPairs[i].GroupName = aws.String(id)
|
||||||
perm.UserIDGroupPairs[i].UserID = nil
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user