# ec2.py and multiple AWS accounts via  AWS STS

**URL:** <https://forum.ansible.com/t/ec2-py-and-multiple-aws-accounts-via-aws-sts/18503>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [June 15, 2015, 1:33pm UTC](https://forum.ansible.com/t/ec2-py-and-multiple-aws-accounts-via-aws-sts/18503 "2015-06-15T13:33:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevin\_fernandes](https://avatars.discourse-cdn.com/v4/letter/k/db5fbb/32.png) [@kevin\_fernandes](https://forum.ansible.com/u/kevin_fernandes)\
**Post date:** [June 15, 2015, 1:33pm UTC](https://forum.ansible.com/t/ec2-py-and-multiple-aws-accounts-via-aws-sts/18503/1 "2015-06-15T13:33:25Z")

</div>

Hi All,

I modified the ec2.py script to support multiple AWS accounts via AWS STS service so that i can scan all the ec2/rds instances in multiple AWS accounts. I have posted the code here

[https://github.com/linuxbsdfreak/ansible-ec2-sts](https://github.com/linuxbsdfreak/ansible-ec2-sts)

Feedbacks/Comments are welcome.

NOTE: I am not a python expert. Just poked around the code to understand it and modify according to my needs.

Regards,  
Kevin
