Lambda trigger on existing s3 bucket

If i need to launch a lambda that gets triggered everytime a new file is added to existing bucket, what should be the settings in serverless.yml file?

Currently, i am following this example and it trys to create a new bucket and fails since the bucket is already existing.

You’ll need to use an existing plugin like https://www.npmjs.com/package/serverless-plugin-existing-s3

This is now possible, without third-party plugins, since Serverless Framework version 1.47.0.
The property
existing:true
should be added to the event trigger.

See the documentation here: https://serverless.com/framework/docs/providers/aws/events/s3#using-existing-buckets
and the associated PR here: https://github.com/serverless/serverless/pull/6290

2 Likes