Hi folks,
So I’m setting up eventing on a new bucket to fire a Lambda. I want to create a new bucket (not attach events to an existing bucket). Following the documentation here I’ve been able to get everything working as expected using the following:
events:
- s3: ${self:custom.properties.${self:custom.environment}.bucketName}
However as soon as I add any complexity to it (filters, multiple events etc.) then the bucket doesn’t create. The rest of the stack is created fine and there are no error messages as the stack is being created or in the AWS cloud formation console, it’s as if the bucket has been removed from serverless.yml altogether.
examples:
events:
- s3:
bucket: ${self:custom.properties.${self:custom.environment}.bucketName}
event: s3:ObjectCreated:*
rules:
- prefix: master/
events:
- s3:
bucket: ${self:custom.properties.${self:custom.environment}.bucketName}
event: s3:ObjectRemoved:*
- s3:
bucket: ${self:custom.properties.${self:custom.environment}.bucketName}
event: s3:ObjectCreated:*
I’m using the latest version of Serverless
Edit the indentation doesn’t seem to be preserved in this post, but in my code things are indented as per the documentation. If they weren’t indented correctly, there would be an error, right?