Is there any s3 job/functionality to move all files that have been there for more than 10 days to another folder automatically (using files and folders for simplicity instead of objects)?
Or that have not been modified for more than 10 days?
My purpose is making a request using an sdk and retrieving the files that have been created in the last 10 days without deleting the others, just move them to a different folder
2
Answers
You can use Amazon S3 Lifecycles.
Please note, in this scenario, you usually move your objects to a different bucket.
I would suggest you consider using AWS Step Functions for this. You can use implement the following workflow:
Wait
state within Step Functions to pause for 10 days (the maximum is one year). Information available hereI would suggest that you move object to a different S3 bucket rather than a different folder. This is because you want to avoid a loop where the movement of your object triggers another Step Functions workflow. You can limit the object prefix on the event rule, but it is safer not to worry about this.