Is it possible to trigger lambda by changing the file of local s3 manually in serverless framework?

400 views Asked by At

I used the serverless-s3-local to trigger aws lambda locally with serverless framework.

Now it worked when I created or updated a file by function in local s3 folder, but when I added a file or changed the context of the file in local s3 folder manually, it didn’t trigger the lambda. Is there any good way to solve it?

1

There are 1 answers

0
Masahiro Wada On

Thanks for using serverlss-s3-local. I'm the author of serverless-s3-local.

How did you add a file or change the context of the file? Did you use the AWS command as following?

$ AWS_ACCESS_KEY_ID=S3RVER AWS_SECRET_ACCESS_KEY=S3RVER aws --endpoint http://localhost:8000 s3 cp ./face.jpg s3://local-bucket/incoming/face.jpg
{
    "ETag": "\"6fa1ab0763e315d8b1a0e82aea14a9d0\""
}

If you don't use the aws command and apply these operations to the files directory, these modifications aren't detected by S3rver which is the local S3 emurator. resize_image example may be useful for you.