Closed codeeno closed 9 months ago
I had the same issue and ended up just defining the NotificationConfiguration
myself for that bucket in the Resources section of serverless.yml. Of course, this only works if the bucket is defined in the same stack.
BucketName: foo
NotificationConfiguration:
LambdaConfigurations:
- Event: s3:ObjectCreated:*
Function: !GetAtt SomeLambdaFunction.Arn
Hi @codeeno,
could you check if you still see this error with the latest
version of localstack? We recently fixed a related issue.
This issue seems to be stale. As we didn't get any response in two months, we are closing this issue now. Please feel free to reopen if it still persists, and provide updates logs and details.
Hello everyone!
I'm currently running into issues when trying to create a Lambda which uses an
s3:ObjectCreated:*
event from an existing S3 bucket as its trigger. While I am able to create the Lambda function itself, the S3 trigger does not seem to be added.Localstack outputs the following warning:
I'm not sure if this is a bug or if I'm forgetting something.
Steps to reproduce
docker run --rm --name localstack --network="localstack-network" -it -p 4566:4566 -p 4510-4559:4510-4559 localstack/localstack
awslocal s3api create-bucket --bucket my-test-bucket --region us-east-1
serverless.yaml
with the following content:provider: name: aws stage: development region: us-east-1
custom: localstack: stages:
plugins:
functions: my-test-function: memorySize: 128 runtime: nodejs16.x timeout: 40 handler: ./index.handler events:
npm init --yes && npm i --save-dev serverless-offline
npx serverless deploy --stage local
awslocal s3api put-object --bucket my-test-bucket --key test/prefix/test.txt --body ./index.js
The Lambda function does not get triggered.
When doing the above setup without creating an S3 bucket and commenting out the
existing: true
line, the Lambda does get triggered when putting an object.