AWS Lambda for objects moved to glacier

那年仲夏 提交于 2019-12-14 04:19:35

问题


I am working on a POC where I have setup a Lifecycle rule on S3 to move objects to glacier after certain no of days (if objects have specified tag). Rule is working fine for me, objects are getting moved to glacier by lifecycle rule and storage type is change to Glacier from Standard. (so far so good).

As I need to restrict user to use that file (archived file) from my application, I am looking for a way to get notification (either through SQS) or invoke Lambda function (to call my application REST endpoint) when object is actually moved to glacier.

I have checked S3 supported event notification types here(http://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html#supported-notification-event-types) but it doesn't have any for storage change or object being moved to glacier.

Let me know if there is any way to configure this or any other approach I can use to achieve this behavior.

Regards.


回答1:


You will not receive Lambda notifications for objects moved from S3 to Glacier via the Lifecycle rules.

When an S3 object is moved to Glacier, the object is not removed from S3. Instead, it's storage type is simply changed from Standard/RR/IA to "Glacier". And there is no notification type for storage type changes.

Also, the AWS documentation states:

You will not receive event notifications from automatic deletes from lifecycle policies or from failed operations.

Source: http://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html#notification-how-to-event-types-and-destinations



来源:https://stackoverflow.com/questions/46571670/aws-lambda-for-objects-moved-to-glacier

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!