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?