# module\_utils/ec2.py Do we need the AWS\_REGION list

**URL:** <https://forum.ansible.com/t/module-utils-ec2-py-do-we-need-the-aws-region-list/17989>\
**Category:** Ansible Developer\
**Tags:** fedora, aws\
**Created:** [April 15, 2015, 10:05pm UTC](https://forum.ansible.com/t/module-utils-ec2-py-do-we-need-the-aws-region-list/17989 "2015-04-15T22:05:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Toshio\_Kuratomi](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@Toshio\_Kuratomi](https://forum.ansible.com/u/Toshio_Kuratomi)\
**Post date:** [April 15, 2015, 10:05pm UTC](https://forum.ansible.com/t/module-utils-ec2-py-do-we-need-the-aws-region-list/17989/1 "2015-04-15T22:05:45Z")

</div>

Fedora Infrastructure is using openstack with the ec2 compat layer and  
thus the region was being set to something local rather than the  
official aws regions. It looks like boto allows this via the  
BOTO\_ENDPOINTS environment variable (or a config file setting).  
However, the ansible ec2 modules are additionally doing a check  
against a hardcoded list of regions.

It seems like we might want to only depend on the regions that boto is  
able to find because boto has less chance to become stale than we do.  
So I'm inclined to accept this PR from them to remove the separate  
check in ansible for this:

[https://github.com/ansible/ansible/pull/10734](https://github.com/ansible/ansible/pull/10734)

I just wanted to check with people who use ec2 more than I do about  
ec2 about whether there would be any unwanted side effects from this  
change.

Thanks for any feedback (here or preferably in the PR),  
-Toshio

---

<div class="post-metadata">

**Author:** ![Jonathan\_Davila](https://avatars.discourse-cdn.com/v4/letter/j/e0b2c6/32.png) [@Jonathan\_Davila](https://forum.ansible.com/u/Jonathan_Davila)\
**Post date:** [April 16, 2015, 4:24pm UTC](https://forum.ansible.com/t/module-utils-ec2-py-do-we-need-the-aws-region-list/17989/2 "2015-04-16T16:24:10Z")

</div>

To do something along these lines has been on my backlog of things to tackle. I think this is a good change. IIRC none of the AWS modules have an dependency on that hardcoded list (to include the dynamic inventory script which looks to the ini file anyways). In the highly unlikely event that this causes a particular module to stop working as intended it would be 1) Relatively easy to fix 2) Something that would have needed to be fixed anyways. 3) Better for the whole of our AWS modules in the long run.
