# A question about the S3 Lifecyle module

**URL:** <https://forum.ansible.com/t/a-question-about-the-s3-lifecyle-module/22879>\
**Category:** Ansible Project\
**Created:** [October 25, 2016, 10:18am UTC](https://forum.ansible.com/t/a-question-about-the-s3-lifecyle-module/22879 "2016-10-25T10:18:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Benjamin\_Copeland1](https://avatars.discourse-cdn.com/v4/letter/b/5f8ce5/32.png) [@Benjamin\_Copeland1](https://forum.ansible.com/u/Benjamin_Copeland1)\
**Post date:** [October 25, 2016, 10:18am UTC](https://forum.ansible.com/t/a-question-about-the-s3-lifecyle-module/22879/1 "2016-10-25T10:18:37Z")

</div>

Hello All,

I want to be able to use the [S3 lifecycle module](http://docs.ansible.com/ansible/s3_lifecycle_module.html) to have _exclude_ rules? I want to be able to delete most files in a bucket, but exclude a couple of folders.

I want to be able to setup lifecycle rules for every file in a bucket, apart from a handful of items.

Thanks

---

<div class="post-metadata">

**Author:** ![Bryan\_Hiestand](https://avatars.discourse-cdn.com/v4/letter/b/cc9497/32.png) [@Bryan\_Hiestand](https://forum.ansible.com/u/Bryan_Hiestand)\
**Post date:** [November 2, 2016, 4:41pm UTC](https://forum.ansible.com/t/a-question-about-the-s3-lifecyle-module/22879/2 "2016-11-02T16:41:57Z")

</div>

Unless things have changed recently, AWS S3 lifecycle policies do not support arbitrary exclude rules. So the lifecycle module will not be able to provide this functionality.

Lifecycle policies can match dates and prefixes. To make use of lifecycles policies, you should use prefixes in a way that will match policies you want.
