Multiple folders inside the serverless folder on multiple deployments

I am deploying couple of lambdas using serverless framework. When I deploy the first time, it created a folder inside the bucket (in the path serverless/service-name/dev/ 1711193273850-2024-05-12T21:05:53.850Z/). Then when I had more changes, I deployed again and it created another similar folder, with exactly same contents (serverless/service-name/dev/1752193273850-2024-05-12T21:25:53.850Z/)). I would like to know if there is any way to restrict the creation of duplicate folders(or at least deleting the old one and just keeping let’s say last N deployments). I am using prune plugin, but it doesn’t seems to be clearing the s3 buckets. Any help/tip will be really helpful and thank you in advance.

What problem are you trying to solve ? This is Just How It Works as far as I know…

There is a very good reason this exists; Serverless Framework allows you to rollback deployments based on what is in the bucket: Serverless Rollback CLI Command

However, you can tune how many previous versions to keep and could set this to 1 if you like. Just add
image