简体   繁体   中英

lifecycle rule from s3 invokes lambda function

I have a case where I have an s3 bucket with a lifecycle rule to delete some of the objects in it.

What I need is to trigger a lambda when the rule has finished the action of deleting the objects.

Is there a way I can attach invocation of lambdas from 3s lifecycles rules? What do I need to use?

I have seen a tutorial that allows you to do it with EC2 utilizing the Amazon EventBridge rule, and as a service name, there is the option S3 On Outputs. Is there something I can do with it?

The tutorial you linked is about EC2 Auto Scaling. This is a totally separate service, so this is not applicable to S3 lifecycle events.

What you can do, is use an S3 event notification to get notified when an object is deleted. But be aware that you will get this notification for each object that gets deleted, so not only after the lifecycle rule has been executed.

Notifications for the lifecycle rule itself, do not exist as of now, but there is a feature request for this with the AWS team for some years now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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