Suggested change for ec2_snapshot - list snapshots

I’ve been working on a change to ec2_snapshot to add a ‘list’ option to the state parameter. This would function in a similar way to the list option in the ec2_vol module.

I have a few thing for discussion…

  1. Should this be additional functionality of ec2_snapshot or a separate module? I think it should be additional functionality because it’s similar functionality to what was added in ec2_vol
  2. I would like to be able to filter the list of snapshots returned. The supported filters are listed here - http://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/ApiReference-cmd-DescribeSnapshots.html. Some of these fields are already part of the module. E.g. volume_id My question is do i add a new parameter called “filter” where you specify the filter as a string, or do I take the existing fields such as volume_id to construct the filter pattern?
    E.g.

ec2_snapshot: state=list volume_id=vol-123456

or

ec2_snapshot: state=list filter=“volume_id: vol-123456”

The reason for this dev is a similar use case as outlined here - https://groups.google.com/forum/#!searchin/ansible-devel/ec2_snapshot/ansible-devel/55hRqyNFK8c/l0JHdZMG_k0J.

There’s a still in progress commit here https://github.com/wimnat/ansible-modules-core/commit/c5f5fa65a1e3fa6e60ba14e687a32d590c4f5f99

Just need to work out the best way to handle filters.

Feedback welcome…