user1246979
user1246979

Reputation: 255

AWS Lambda for objects moved to glacier

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.

Upvotes: 3

Views: 2184

Answers (1)

Matt Houser
Matt Houser

Reputation: 36073

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

Upvotes: 4

Related Questions