# Suggested change for ec2\_snapshot - list snapshots

**URL:** <https://forum.ansible.com/t/suggested-change-for-ec2-snapshot-list-snapshots/17324>\
**Category:** Ansible Developer\
**Tags:** aws\
**Created:** [January 20, 2015, 11:29am UTC](https://forum.ansible.com/t/suggested-change-for-ec2-snapshot-list-snapshots/17324 "2015-01-20T11:29:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rob\_White](https://avatars.discourse-cdn.com/v4/letter/r/71c47a/32.png) [@Rob\_White](https://forum.ansible.com/u/Rob_White)\
**Post date:** [January 20, 2015, 11:29am UTC](https://forum.ansible.com/t/suggested-change-for-ec2-snapshot-list-snapshots/17324/1 "2015-01-20T11:29:41Z")

</div>

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](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](https://groups.google.com/forum/#!searchin/ansible-devel/ec2_snapshot/ansible-devel/55hRqyNFK8c/l0JHdZMG_k0J).

---

<div class="post-metadata">

**Author:** ![Rob\_White](https://avatars.discourse-cdn.com/v4/letter/r/71c47a/32.png) [@Rob\_White](https://forum.ansible.com/u/Rob_White)\
**Post date:** [January 22, 2015, 6:47am UTC](https://forum.ansible.com/t/suggested-change-for-ec2-snapshot-list-snapshots/17324/2 "2015-01-22T06:47:30Z")

</div>

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

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

Feedback welcome…
