Ec2 dynamic inventory, sorting by something else than InstanceId?

Hii, I’m trying to move away from the old ec2.py dynamic inventory to the current (supported) amazon.aws.aws_ec2 inventory – EC2 inventory source — Ansible Community Documentation.

I have everything working - execpt one thing. The current inventory script has hard coded sorting of the found instances by InstanceId: amazon.aws/plugins/inventory/aws_ec2.py at main · ansible-collections/amazon.aws · GitHub

Our old ec2.py had a local patch, to allow sorting by the value of the Name tag (or other tags).

Before I try to create a similar patch for the current plugin, would such a feature be acceptable?

thx

Yes, amazon.aws also accept community contributions GitHub - ansible-collections/amazon.aws: Ansible Collection for Amazon AWS

What’s the usecase for sorting instances in the inventory?

See aws_ec2_inventory: Allow sorting by something else than InstanceId · Issue #2672 · ansible-collections/amazon.aws · GitHub.
I closed it again as there is something already that does what we need :slight_smile: