- I am trying to get a list of security groups. (Successful - Using Get-EC2SecurityGroup)
- Get a list of the specific IPPermissions associated with each security group. ( Successful - Using (Get-EC2SecurityGroup).IpPermissions )
- Only return results where the FromPort = "xxx" ( Unsuccessful - Not sure how to access the FromPort property that is returned in the result list )
Ultimately what I am trying to accomplish is:
-
Get a list of existing security groups, and loop through each group.
-
While looping through each group, call the IpPermissions, and look for the specific FromPort "xxx".
-
If the FromPort is a match, record the other properties: (FromPort, IpProtocol, IpRanges, ToPort, UserIdGroupPairs)
Problem I am having
-
I am not sure how to do a loop using the amazon objects
-
I cant seem to access the properties even though they appear to be named and have values.
-
I have tried using -Filter with many different iterations, with no success.
-
The documentation seems self-referencing, and the examples I have run across dont get down to this level of detail.
Results returned from (Get-EC2SecurityGroup).IpPermissions
FromPort : 123
IpProtocol : tcp
IpRanges : {0.0.0.0/0}
ToPort : 123
UserIdGroupPairs : {}
Aucun commentaire:
Enregistrer un commentaire