auto delete aws S3 backups
I think you're on the right track. Just need a tiny bit more logic on the backup process, then S3 can handle the rest.
Consider this:

A backup is uploaded every day.
If today is January 1st (for example), the backup is given a &quot;yearly&quot; tag.
Otherwise, if today is the 1st of the month, the backup is given a &quot;monthly&quot; tag.
Otherwise, if today is a Sunday, the backup is given a &quot;weekly&quot; tag.
Otherwise the backup is given a &quot;daily&quot; tag.

Next, set up S3 Bucket Lifecycle Policies with each tag as the filter.

Transition &quot;yearly&quot; backups to Glacier after 365 days (kept indefinitely)
Delete &quot;monthly&quot; backups after 365 days (1 year)
Delete &quot;weekly&quot; backups after 183 days (6 months)
Delete &quot;daily&quot; backups after 31 days (1 month)

References:

https://docs.aws.amazon.com/AmazonS3/latest/user-guide/create-lifecycle.html
https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-configuration-examples.html