Join egghead, unlock knowledge.

Want more egghead?

This lesson is for members. Join us? Get access to all 3,000+ tutorials + a community with expert developers around the world.

Unlock This Lesson
1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

    Create an S3 event notification to trigger a lambda function on file upload

    awsAWS

    A huge part of building serverless applications with AWS is being able to connect certain cloud resources and have them react to certain events.

    Currently our HelloLambda function can be triggered by a GET request event sent to the API Gateway, but that's not the only use case when a lambda function can be triggered.

    Suppose we'd like to trigger the lambda function whenever a file is uploaded to an S3 bucket, for instance, to generate a thumbnail. Once a thumbnail is generated, lambda function can call another function etc., this behaviour is up to us to define.

    In order to call a lambda function when a file is uploaded to an S3 bucket, we need to use an s3Notifications construct - and that's exactly what we're going to do in this quick lesson.