1

I can create lambda function from AWS SDK something like that:

var aws = require('aws-sdk');
var lambda = new aws.Lambda();
lambda.createFunction({
    FunctionName: 'name',
    Code: {
      ZipFile: 'zip content'
    },
    Role: 'role'
  }).promise();

But how can i specify that this function should trigger with S3 upload?

1 Answer 1

1

You do this from the S3 SDK, specifically putBucketNotificationConfiguration.

You configure a notification configuration that indicates a Lambda function as the handler for specific S3 notification events, for example s3:ObjectCreated:Put. Be aware that, depending on how the upload happens, uploads can result in different events, e.g. Put, Post, and CompleteMultipartUpload.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.