Object deletion from a non version bucket

0

Hi Team,

I am facing some issue with my bucket object I have a requirement of deletion of objects with lifecycle or with object policy.

My requirement I have 10 folders in my bucket in that each folder again I have 2 folder in that each folder we have multiple objects so I want to keep only 2 latest object and delete all objects and I don't want to delete folders

Non-version bucket with individual objects Please help me to solve this puzzle

1 Respuesta
0
Respuesta aceptada

I don't believe that you can maintain a number of 'latest' versions using a lifecycle rule unless you are using a bucket versioning. I think the solution may be to use a Lambda function to review the files in your bucket and to remove the ones you don't need. This function could be scheduled as frequently as needed, or on PUT events using EventBridge.

AWS
Alex_K
respondido hace 2 años
profile picture
EXPERTO
revisado hace un mes

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas