Reputation: 2571
Looking at the aws docs it says that you can use filters to get or values like:
tag:key=value
The key/value combination of a tag assigned to the resource.
Example: To list the resources with the tag Purpose=X, use:
--filter tag:Purpose=X
Example: To list resources with the tag Purpose=X or the tag Purpose=Y, use:
--filter tag:Purpose=X --filter tag:Purpose=Y
But in boto you store the tags in a dictionary (from get all snapshots):
"filters (dict) – Optional filters that can be used to limit the results returned. Filters are provided in the form of a dictionary consisting of filter names as the key and filter values as the value. The set of allowable filter names/values is dependent on the request being performed. Check the EC2 API guide for details."
If you want to do an OR you then need two entries in your dictionary with key 'tag:Purpose', which clearly doesn't work. Does anyone know if there is a work around for this? Or does boto not support OR value filtering?
Upvotes: 1
Views: 255
Reputation: 2571
Never mind I figured it out.
You can pass a list so {'tag:Purpose': ['X', 'Y']}
Super easy.
Upvotes: 1