# Getting region on localhost

**URL:** <https://forum.ansible.com/t/getting-region-on-localhost/29631>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [February 6, 2019, 3:09pm UTC](https://forum.ansible.com/t/getting-region-on-localhost/29631 "2019-02-06T15:09:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wes\_Tibbitts](https://avatars.discourse-cdn.com/v4/letter/w/3da27b/32.png) [@Wes\_Tibbitts](https://forum.ansible.com/u/Wes_Tibbitts)\
**Post date:** [February 6, 2019, 3:09pm UTC](https://forum.ansible.com/t/getting-region-on-localhost/29631/1 "2019-02-06T15:09:51Z")

</div>

I’m running a small playbook that runs commands to create AWS infrastructure from the localhost. I want to use the localhosts region as the default, but using instance metadata to get the AZ and then parsing the region just seems hacky. Is there a clean way to get the region for localhost similar to how I can use ec2\_region with dynamic inventory?
