Reputation: 1097
Given a VPC ID, find all gateways attached to it.
I tried to use filters, like these here, but I always get exceptions:
gws = conn.get_all_internet_gateways(filters={'attachments': vpc.id})
gws = conn.get_all_internet_gateways(filters={'InternetGatewayAttachment': vpc.id})
What's the correct filter here?
What are the filters allowed in this context?
The documentation on this topic is pretty scarce.
Upvotes: 0
Views: 2292
Reputation: 45856
The AWS documentation for the DescribeInternetGateways request shows the available filters. I think you want:
gws = conn.get_all_internet_gateways(filters={'attachment.vpc-id': vpc.id})
Upvotes: 1