Reputation: 71
I'm doing some training on serverless applications and upon trying to build a new stack I receive the following error:
Configuration warning at 'functions['s3-thumbnail-generator'].events[0]': unsupported function event
functions:
s3-thumbnail-generator:
handler: handler.s3-thumbnail-generator
events:
- s3:
bucket: ${self:custom.bucket}
event: s3:ObjectCreated:*
rules:
-suffix: .png
I cannot tell what is wrong. Can anyone let me know?
Thanks,
Upvotes: 0
Views: 832
Reputation: 39
You missed the 2 space indentation on - s3:
and 4 space indentation on lines after - s3
, so this should work:
functions:
s3-thumbnail-generator:
handler: handler.s3-thumbnail-generator
events:
- s3:
bucket: ${self:custom.bucket}
event: s3:ObjectCreated:*
rules:
- suffix: .png
Reference: https://www.serverless.com/framework/docs/providers/aws/events/s3/
Upvotes: 1
Reputation: 428
A potential answer is the indenting isn't "correct". Quotes because it's more indent than normal YML takes.
See https://stackoverflow.com/a/64546429/7902967 for more information.
Upvotes: 1