Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

listing inbounds for a security group of AWS EC2 inctances using Python boto

I am able to list all the security group using get_all_security_groups()

I am also able to list inbound rules for a security group. but I want to see the source also for a rule (inbound rule) using boto.

I tried to find out on google but could not see any way to see the source for a inbound rule.

if anyone know please share

like image 302
Alok Avatar asked Dec 07 '25 09:12

Alok


1 Answers

finally got solution

 for group in self.conn.get_all_security_groups():
        for rule in group.rules:
            print dir(rule)

            for grant in rule.grants:
                print dir(grant)

thanks to boto user mailing list

like image 66
Alok Avatar answered Dec 10 '25 00:12

Alok



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!