Closed lyoungstratus closed 1 year ago
Thanks for reporting this. I was able to reproduce the problem, but I didn't immediately see anything in the code that seemed like the root cause. I'll continue investigating.
Hello, after reproducing this, it appears to be simply a visualization issue.
If I type:
PS C:\> (get-ec2securitygroup -Select SecurityGroups.IpPermissions -GroupId sg-06f33aabb63b3c0cf)
FromPort : 0
IpProtocol : -1
Ipv4Ranges : {}
Ipv6Ranges : {}
PrefixListIds : {}
ToPort : 0
UserIdGroupPairs : {}
But when I type:
PS C:\Users\prospm> (get-ec2securitygroup -Select SecurityGroups.IpPermissions -GroupId sg-06f33aabb63b3c0cf) | ConvertTo-Json
{
"IpRanges": [],
"FromPort": 0,
"IpProtocol": "-1",
"Ipv4Ranges": [],
"Ipv6Ranges": [],
"PrefixListIds": [],
"ToPort": 0,
"UserIdGroupPairs": [
{
"Description": null,
"GroupId": "sg-06f33aabb63b3c0cf",
"GroupName": null,
"PeeringStatus": null,
"UserId": "252047219677",
"VpcId": null,
"VpcPeeringConnectionId": null
}
]
}
Unfortunately PowerShell default printout of the object collapses UserIdGroupPairs
in a way that leads to confusion. And it is easy to think that the list is actually empty.
I will research if there is anything we can do to push PowerShell to do a less confusing printout of these objects.
Thanks for reporting this issue.
We have noticed this issue has not received attention in 1 year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue.
Provide a general summary of the issue in the Title above.
When retrieving a security group with a UserID group pair in its ingress ippermissions, the UserIDGroupPairs property should be populated.
Current Behavior
I retrieved a security group that has a UserID group pair in its ingress ippermissions, and the UserIDGroupPairs property was returned as empty. Using the aws cli the property was populated as expected.
Possible Solution
Not required, but suggest a fix/reason for the bug, or ideas how to implement the addition or change.
Steps to Reproduce (for bugs) I created a security group within my VPC which had a reference to another security group. I then retrieved it with powershell:
I retrieved the same security group with Aws cli:
Context
How has this issue affected you? What are you trying to accomplish? Providing context helps us come up with a solution that is most useful in the real world.
Your Environment