I want to setup a S3 Bucket event for ObjectCreate (All) to send to a SQS queue (not to trigger the Lambda directly). To set the Lambda in Serverless.yml I would:
- s3:
bucket: ${self:custom.secrets.S3_INBOUND_EINVOICE}
event: s3:ObjectCreated:*
Where can I add “Send to SQS”?
1 Like
In theory (didn’t try it myself yet) you create the queue and the bucket as a separate resources under resources:
and configure S3 to send events to the queue. Something along the lines of
resources:
Resources:
DestinationQueue:
[...]
SourceBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: SourceBucket
NotificationConfiguration:
QueueConfigurations:
- Event: s3:ObjectCreated:*
Queue: {"Ref": "DestinationQueue"}
Then you hook your Lambda to the queue according to the fine manual https://serverless.com/framework/docs/providers/aws/events/sqs/
1 Like
Did you ever find a way to solve this? I’m having the same issue, and the solution provided by @terotil is not working for me.
Still no go on this… Anyone that has found a solution?
What I am trying to do is to have my function (Lambda) triggered from SQS, but that SQS queue should be “fed” from an S3 Bucket.
I want to be able to create the S3 Bucket, the SQS queue, S3 event trigger for SQS and the SQS trigger for the Lambda from Serverless.