The use of the Compliance settings on a bucket (a feature used to achieve bucket immutability or WORM-style storage) allow you to make sure that no files are modified or deleted ahead of a certain time, and with the option to delete after retention, you can automatically have files deleted when that period concludes. Here's a quick test to show you this:
Testing the system deleting files when setting versioning and Compliance and setting a delete after retention time:
- Set up bucket with versioning enabled. I made my test bucket named “pankaj-bucket-for-delete-after-retention”
- Then also set compliance by going to Bucket Settings --> Compliance Page
Note that for this example, I set the retention time to be only 1 day. You may set that to be in days/weeks/months or years (but you cannot set it in hours).
- Now, copy your files up to that bucket, Notice that these test files look as follows:
- And, since we have versioning enabled, If I copy up one of the files AGAIN, the old image is kept as a version and not displayed unless you select the Bucket Versioning Icon (the file/folder with clock sign in the upper right of the scree):
- Now, when we go back to the system ONE day after the files were created (I set the compliance time to be ONE DAY. The files will be gone. So, moments after my one day retention period expires, I see this in my bucket: