Preserving Folder Structure While Applying S3 Deletion Rule

48 Views Asked by At

I have my S3 Bucket where I want apply the rule for a folder inside C3/TempData/Tasks I want that the entire data inside my Tasks fodler should get deleted. the rule worked accordingly, but it also delted the Tasks folder, how can I apply the rule so my Tasks folder should not get delete. Please guide me with the correct steps/resolution.

1

There are 1 best solutions below

1
Roronoa Zoro On
  • It sounds like you're using Amazon S3 Lifecycle rules to automatically delete objects in the "Tasks" folder inside your S3 bucket.
  • However, you want to ensure that the "Tasks" folder itself is not deleted.
  • The behavior you're experiencing is expected because S3 doesn't actually have folders; it uses a flat namespace with keys that include the full path.
  • When you delete all objects with a certain prefix (such as "C3/TempData/Tasks/"), it effectively removes the "folder" as well.

I think this might have answered your question.