-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
feat(networkfirewall): change network_firewalls
from list to dict
#5169
feat(networkfirewall): change network_firewalls
from list to dict
#5169
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remember to change how we use network_firewalls
inside networkfirewall_deletion_protection
and networkfirewall_in_all_vpc
and all the related tests :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for this! 💪🏼
@@ -27,13 +27,14 @@ def _list_firewalls(self, regional_client): | |||
network_firewall["FirewallArn"], self.audit_resources | |||
) | |||
): | |||
self.network_firewalls.append( | |||
self.network_firewalls[network_firewall.get("FirewallArn")] = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.network_firewalls[network_firewall.get("FirewallArn")] = ( | |
self.network_firewalls[network_firewall.get("FirewallArn", "")] = ( |
@@ -27,13 +27,14 @@ def _list_firewalls(self, regional_client): | |||
network_firewall["FirewallArn"], self.audit_resources | |||
) | |||
): | |||
self.network_firewalls.append( | |||
self.network_firewalls[network_firewall.get("FirewallArn")] = ( | |||
Firewall( | |||
arn=network_firewall.get("FirewallArn"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please could you remove the ARN from the model since that information is already in the key
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5169 +/- ##
==========================================
+ Coverage 89.12% 89.24% +0.11%
==========================================
Files 976 976
Lines 29909 29951 +42
==========================================
+ Hits 26657 26730 +73
+ Misses 3252 3221 -31 ☔ View full report in Codecov by Sentry. |
Context
network_firewalls
variable is a list, but this does not align with other services structure and scalability.Description
network_firewalls
has been changed from list to dict. This change will improve performance when accessing this variable and make the code more readable and maintainable. The new structure maintains backward compatibility and include necessary adjustments to any methods or functions interacting with the firewall list.Checklist
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.