add ec2 network-acl egress filter (#5174)
This commit is contained in:
parent
e372287147
commit
68b93c3b86
@ -238,6 +238,8 @@ class NetworkAcl(TaggedEC2Resource):
|
||||
return [entry.rule_number for entry in self.network_acl_entries]
|
||||
elif filter_name == "entry.rule-action":
|
||||
return [entry.rule_action for entry in self.network_acl_entries]
|
||||
elif filter_name == "entry.egress":
|
||||
return [entry.egress for entry in self.network_acl_entries]
|
||||
elif filter_name == "owner-id":
|
||||
return self.owner_id
|
||||
else:
|
||||
|
@ -385,6 +385,21 @@ def test_describe_network_acls():
|
||||
)
|
||||
resp4["NetworkAcls"].should.have.length_of(0)
|
||||
|
||||
# Ensure filtering by egress flag
|
||||
resp4 = conn.describe_network_acls(
|
||||
Filters=[{"Name": "entry.egress", "Values": ["false"]}]
|
||||
)
|
||||
[entry["NetworkAclId"] for entry in resp4["NetworkAcls"]].should.contain(
|
||||
network_acl_id
|
||||
)
|
||||
# the ACL with network_acl_id contains no entries with Egress=True
|
||||
resp4 = conn.describe_network_acls(
|
||||
Filters=[{"Name": "entry.egress", "Values": ["true"]}]
|
||||
)
|
||||
[entry["NetworkAclId"] for entry in resp4["NetworkAcls"]].shouldnt.contain(
|
||||
network_acl_id
|
||||
)
|
||||
|
||||
# Ensure filtering by rule action
|
||||
resp4 = conn.describe_network_acls(
|
||||
Filters=[
|
||||
|
Loading…
Reference in New Issue
Block a user