AWS S3 PutObject automatically creates a S3 Presigned URl and emails the link via SNS topic
Sample lambda functions that run based on S3 event trigger
on s3:ObjectCreated
.
UPDATE
Upload objects greater than 16MB+ requires the additional event trigger of s3:ObjectCreated:CompleteMultipartUpload
.
Kudus for AWS Support for helping me with the troubleshoot.
1) SNS topic with email, txt, ... subscribers.
2) Create S3 event trigger with the lambda funtion as a target
S3 events for:
-
s3:ObjectCreated:Put
-
s3:ObjectCreated:CompleteMultipartUpload
3) Target a lambda functions to run below logic
- DISCLAIMER >>
Use at your own responsability.
<<
Sample Lambda code
UPDATE and other details
Upload objects greater than 16MB+ requires the additional event trigger of s3:ObjectCreated:CompleteMultipartUpload
.
Kudus for AWS Support for helping me with the troubleshoot.
S3 events trigger for:
-
s3:ObjectCreated:Put
-
s3:ObjectCreated:CompleteMultipartUpload
Objects greater than 16MB
are getting uploaded as a Multipart
uploads.
Multipart upload allows us to upload a single object as a set of parts. Each part is a contiguous portion of the object's data.
S3 bucket event s3:ObjectCreated:Put
provides notification when an object is created by an HTTP PUT operation.
S3 bucket event s3:ObjectCreated:CompleteMultipartUpload
provides notification for an object which was created by the completion of a S3 multi-part upload
.
Documentation
-
Multipart
upload - https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html -
https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-event-notifications.html
Happy learning
Antonio Feijao