# EC2 Inventory plugin AND

**URL:** <https://forum.ansible.com/t/ec2-inventory-plugin-and/17616>\
**Category:** Ansible Project\
**Created:** [February 24, 2015, 11:46pm UTC](https://forum.ansible.com/t/ec2-inventory-plugin-and/17616 "2015-02-24T23:46:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Richardson](https://avatars.discourse-cdn.com/v4/letter/d/a4c791/32.png) [@Daniel\_Richardson](https://forum.ansible.com/u/Daniel_Richardson)\
**Post date:** [February 24, 2015, 11:46pm UTC](https://forum.ansible.com/t/ec2-inventory-plugin-and/17616/1 "2015-02-24T23:46:24Z")

</div>

Is there any way to use AND in the instance\_filters parameter instead of OR?

For instance I would like to be able to filter on

tag:env=stage  
AND  
tag:Owner=me

---

<div class="post-metadata">

**Author:** ![Chris\_Church1](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@Chris\_Church1](https://forum.ansible.com/u/Chris_Church1)\
**Post date:** [February 26, 2015, 6:12am UTC](https://forum.ansible.com/t/ec2-inventory-plugin-and/17616/2 "2015-02-26T06:12:19Z")

</div>

Not at the moment. It's possible via boto and the EC2 API. I'd propose  
using a syntax such as:

instance\_filters = tag:env=stage&tag:Owner=me

---

<div class="post-metadata">

**Author:** ![Timothy\_Gerla](https://avatars.discourse-cdn.com/v4/letter/t/977dab/32.png) [@Timothy\_Gerla](https://forum.ansible.com/u/Timothy_Gerla)\
**Post date:** [March 9, 2015, 1:53am UTC](https://forum.ansible.com/t/ec2-inventory-plugin-and/17616/3 "2015-03-09T01:53:31Z")

</div>

Hi Chris and Daniel,

I took a stab at implementing this: [https://github.com/ansible/ansible/pull/10413](https://github.com/ansible/ansible/pull/10413)

Comments appreciated!

-Tim
