# creating a custom script in AWX

**URL:** <https://forum.ansible.com/t/creating-a-custom-script-in-awx/27770>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [June 11, 2018, 6:11pm UTC](https://forum.ansible.com/t/creating-a-custom-script-in-awx/27770 "2018-06-11T18:11:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin\_Yang](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@Martin\_Yang](https://forum.ansible.com/u/Martin_Yang)\
**Post date:** [June 11, 2018, 6:11pm UTC](https://forum.ansible.com/t/creating-a-custom-script-in-awx/27770/1 "2018-06-11T18:11:06Z")

</div>

Hi I’ve been managing ec2 instances using AWX and noticed instance\_filter does not provide me with inverse filter; only provides AND or OR filter. So I decided i should create a custom script, based on ec2.py in ansible git, to include inverse filter feature for future use.

However, when I created a custom script from ec2.py(with no change), created a new inventory with the custom script as new source, and tried to obtain new hosts, it would only return me some elasticache instances.

When I set “elasticache = false” in the custom script, it returned nothing.

I think the problem is environment variables not being fed to the script properly.

I need help from whoever worked with awx custom script before!

Thanks.

FYI, these are my environment variables
