Tes M
Tes M

Reputation: 51

How to move s3 bucket to glacier storage using boto3

How to move s3 buckets to glacier storage immediately based on some triggers such as tag change or if there is no activity on the s3 buckets for a given period of time using boto3. I checked on adding life cycle policy but I can set the transition period only from the date of object creation. But its not suffice for my requirement. I need to move the entire bucket to glacier on nth day if there is no activity for 'n' days

Upvotes: 0

Views: 361

Answers (1)

balderman
balderman

Reputation: 23815

The idea is to use cloud trail and monitor the bucket activity. You can have a lambda function that wake up every N hours, read the cloud trail log for the bucket[s] and if there was no activity for H hours/days/... it will change the storage class of the bucket to the desired storage class.

Upvotes: 1

Related Questions