简体   繁体   English

如何使用 boto3 将 s3 存储桶移动到冰川存储

[英]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.如何根据一些触发因素(例如标签更改)或使用 boto3 在给定时间段内 s3 存储桶上没有活动时立即将 s3 存储桶移动到冰川存储。 I checked on adding life cycle policy but I can set the transition period only from the date of object creation.我检查了添加生命周期策略,但我只能从 object 创建之日起设置过渡期。 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如果 'n' 天没有活动,我需要在第 n 天将整个水桶移到冰川

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.您可以有一个 lambda function 每隔 N 小时唤醒一次,读取存储桶 [s] 的云跟踪日志,如果 H 小时/天/...没有活动,它将更改存储桶 ZA2F2ED4F8EBC40AB61 的存储空间为所需的存储 class。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM