# ansible with AWS inventory (ec2.py) returns rds, etc

**URL:** <https://forum.ansible.com/t/ansible-with-aws-inventory-ec2-py-returns-rds-etc/18147>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [May 1, 2015, 6:43pm UTC](https://forum.ansible.com/t/ansible-with-aws-inventory-ec2-py-returns-rds-etc/18147 "2015-05-01T18:43:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raj\_Desikavinayagomp](https://avatars.discourse-cdn.com/v4/letter/r/54ee81/32.png) [@Raj\_Desikavinayagomp](https://forum.ansible.com/u/Raj_Desikavinayagomp)\
**Post date:** [May 1, 2015, 6:43pm UTC](https://forum.ansible.com/t/ansible-with-aws-inventory-ec2-py-returns-rds-etc/18147/1 "2015-05-01T18:43:39Z")

</div>

Hello,  
Running the ec2.py inventory script as follows

ec2.py --list

I have a filter for instance type based on app name=‘xyx’.

This should return only sepecific app-servers which I am restricing in the call.  
But it returning all hosts in the group including the rds instance names.  
Filter in ec2.ini is not working either. Is there any debug option available to troubleshoot the same issue?

thanks  
dnraj

---

<div class="post-metadata">

**Author:** ![Baraa\_Basata1](https://avatars.discourse-cdn.com/v4/letter/b/848f3c/32.png) [@Baraa\_Basata1](https://forum.ansible.com/u/Baraa_Basata1)\
**Post date:** [May 2, 2015, 6:47pm UTC](https://forum.ansible.com/t/ansible-with-aws-inventory-ec2-py-returns-rds-etc/18147/2 "2015-05-02T18:47:46Z")

</div>

Hi Raj,

There is an option in ec2.ini to exclude RDS instances:

[https://github.com/ansible/ansible/blob/a87d8891826246cceb15961cfbbd6a2c728afb52/plugins/inventory/ec2.ini#L44-L45](https://github.com/ansible/ansible/blob/a87d8891826246cceb15961cfbbd6a2c728afb52/plugins/inventory/ec2.ini#L44-L45)

I hope this is helpful.  
-Baraa

---

<div class="post-metadata">

**Author:** ![Raj\_Desikavinayagomp](https://avatars.discourse-cdn.com/v4/letter/r/54ee81/32.png) [@Raj\_Desikavinayagomp](https://forum.ansible.com/u/Raj_Desikavinayagomp)\
**Post date:** [May 5, 2015, 12:20am UTC](https://forum.ansible.com/t/ansible-with-aws-inventory-ec2-py-returns-rds-etc/18147/3 "2015-05-05T00:20:40Z")

</div>

Thanks Baraa.  
I wrote a custom AWS shell script to create an inventory file for my needs.

[https://github.com/dnraj/ec2scripts/blob/master/scripts/generate\_ansible\_aws\_inventory.sh](https://github.com/dnraj/ec2scripts/blob/master/scripts/generate_ansible_aws_inventory.sh)
