ec2_eni module should honour description for uniqueness

Hi,

Just filed https://github.com/ansible/ansible/issues/19972

“The ec2_eni module does not create a new ENI and instead updates the description of an existing ENI that matches its other args. This is important for the cases when we don’t know the IP address nor want to attach it to an instance and just want to create an ENI.”

…and was looking at a possible fix.

I found the relevant commit: https://github.com/ansible/ansible/commit/f8314c3e618c4050f8e957c780f66523111076c8

It does make me wonder if the change in behaviour (excluding the description and security groups from what identifies an ENI) wasn’t intentional. See find_eni().

I’m happy to contribute a fix but would like input from Filipe and others on what makes more sense:

  1. include back description and security_groups attributes in the find_eni filters;
  2. instead allow for a state=created that expects the ID and IP address to be omitted and creates or fails but doesn’t update;
  3. do nothing?

Thanks,

Vasco