creating a custom script in AWX

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