Adding VPN Gateway filters (#3155)

* Adding attchment.vpc-id, attachment.state, type, and vpn-gateway-id filters for VPN Gateways. fixes #3154

* Run formatting on tests

Co-authored-by: Alan Baldwin <alan.baldwin.jr@gmail.com>
This commit is contained in:
Alan Baldwin 2020-07-21 09:08:49 -06:00 committed by GitHub
commit b09c8034e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 142 additions and 1 deletions

View file

@ -4973,6 +4973,14 @@ class VpnGateway(TaggedEC2Resource):
super(VpnGateway, self).__init__()
def get_filter_value(self, filter_name):
if filter_name == "attachment.vpc-id":
return self.attachments.keys()
elif filter_name == "attachment.state":
return [attachment.state for attachment in self.attachments.values()]
elif filter_name == "vpn-gateway-id":
return self.id
elif filter_name == "type":
return self.type
return super(VpnGateway, self).get_filter_value(
filter_name, "DescribeVpnGateways"
)