Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elb sg #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions aws_visualizer/dot/graph_region.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,13 @@ def load_assigned_security_groups(self):
self.assigned_security_groups = {}
for instance in self.instances:
self.assigned_security_groups[instance] = list(map(
lambda g: SecurityGroup(g), instance['SecurityGroups']))
lambda g: SecurityGroup(g), instance.get('SecurityGroups', [])))

def load_assigned_lb_security_groups(self):
self.assigned_lb_security_groups = {}
for lb in self.loadbalancers:
self.assigned_lb_security_groups[lb] = list(map(
lambda g: self.get_security_group_by_id(g), lb['SecurityGroups']))
lambda g: self.get_security_group_by_id(g), lb.get('SecurityGroups', [])))

def get_networks_of_rule_refering_to_external_address(self, vpc, rule):
cidrs = rule['IpRanges'] if 'IpRanges' in rule else set()
Expand Down Expand Up @@ -371,7 +371,7 @@ def load_security_table_of_vpc(self, vpc_id):
self._add_security_group_to_table(instance, group)

for loadbalancer in self.get_loadbalancers_in_vpc(vpc_id):
for sg in loadbalancer['SecurityGroups']:
for sg in loadbalancer.get('SecurityGroups', []):
group = self.get_security_group_by_id(sg)
self._add_security_group_to_table(loadbalancer, group)

Expand Down