Unable to trigger Lamda from S3

Issue #43 resolved
Former user created an issue

Hi,

I'm trying to fire a Lambda function when a new file is created on S3.

So I did the following :

  • created my Lambda function => ok
  • tested the Lambda using aws cli "invoke" -> ok

then I used the following to add notification to S3 so that it will run my Lambda on new file :

aws --endpoint-url=http://localhost:4572 s3api put-bucket-notification \ --bucket "in" \ --notification-configuration file://cloud.json

cloud.json looks like that: { "CloudFunctionConfiguration": { "CloudFunction": "arn:aws:lambda:us-east-1:000000000000:function:inOut", "Events": [ "s3:ObjectCreated:*" ] }

}

aws --endpoint-url=http://localhost:4572 s3api get-bucket-notification --bucket "in" ==> no error but return nothing ???

Then used this one to copy a file to S3:

aws --endpoint-url=http://localhost:4572 s3 cp hello.txt s3://in/oli.txt

my Lambda was supposed to copy that file to another folder, but nothing append...

I also did a try with S3 sending event to SQS and that was working fine ( except for aws --endpoint-url=http://localhost:4572 s3api get-bucket-notification --bucket "in" which doesn't show anything...)

So could you tell me Lambda can be called from S3 or if this is a known limitation ?

Comments (4)

  1. Olivier Carnal

    Thanks you very much, I can confirm this is working for me ! The only thing that is still a bit weird is that

    aws --endpoint-url=http://localhost:4572 s3api get-bucket-notification --bucket "in"

    doesn't show anything... but the lambda is triggered.

  2. Log in to comment