# ec2.py filtering issue

**URL:** <https://forum.ansible.com/t/ec2-py-filtering-issue/17483>\
**Category:** Ansible Project\
**Created:** [February 9, 2015, 11:09pm UTC](https://forum.ansible.com/t/ec2-py-filtering-issue/17483 "2015-02-09T23:09:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gary\_Malouf](https://avatars.discourse-cdn.com/v4/letter/g/4bbf92/32.png) [@Gary\_Malouf](https://forum.ansible.com/u/Gary_Malouf)\
**Post date:** [February 9, 2015, 11:09pm UTC](https://forum.ansible.com/t/ec2-py-filtering-issue/17483/1 "2015-02-09T23:09:31Z")

</div>

I’m attempting to separate my staging and production server via two different vpcs. I’m using a filter as follows in each of ec2.ini files to separate instances running in the staging vpc from those in the production one.

instance\_filters = vpc-id=vpc-someid

This works well for filtering out EC2 instances and load balancers that are not in the specified vpc. However, I am seeing meta-data come back for an RDS instance that is running in a different vpc. Does anyone else get similar behavior - I’m trying to figure out if this is a bug or expected behavior.

---

<div class="post-metadata">

**Author:** ![James\_Cammarata](https://avatars.discourse-cdn.com/v4/letter/j/7c8e57/32.png) [@James\_Cammarata](https://forum.ansible.com/u/James_Cammarata)\
**Post date:** [February 10, 2015, 6:29am UTC](https://forum.ansible.com/t/ec2-py-filtering-issue/17483/2 "2015-02-10T06:29:17Z")

</div>

Hi Gary, I believe this is expected behavior. You can set rds=False in the ec2.ini to have RDS instance information removed from the dynamic inventory results.

Hope that helps!
