How to delete versions of an object in S3 bucket via lifecycle rules

851 Views Asked by At

I have set up an S3 bucket consisting of 2 main paths:

  • private/
  • public/

For the private/ folder I would like the following rule to be set up:

  • Versions of all files in private/ are sent to S3 Glacier Instant Retrieval* and are kept for a minimum of 10 years.

And for the public/ folder the following rule:

  • Versions of all files in public/ are sent to S3 Glacier Instant Retrieval* and are kept for a minimum of 6 months.

I currently have created the lifecycle rule for the public/ folder on a testing S3 bucket, and I have tried setting the expiration date to 1 day, to see if it works. However it does not. This is the lifecycle rule which I created: public lifecycle rule on test bucket

So basically I have selected:

  • "Move noncurrent versions of objects between storage classes" checked and in this one I choose the option Glacier Instant Retrieval with 0 days after objects become noncurrent. And left the "Number of newer versions to retain" field empty.

For this point when I browse to my S3 bucket and I click on a version that has the delete marker set on them, it shows me "Storage class: Standard". Why is this not in the Glacier Instant Retrieval storage?

  • "Permanently delete noncurrent versions of objects" checked and I selected 1 in the "Days after objects become noncurrent".

For the object I am looking at the versions, they are all 2 days old but they are still all in there. Why aren't they deleted?

0

There are 0 best solutions below