0

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,

2 Answers2

1

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.

Damon Stamper
  • 378
  • 1
  • 4
  • 16
1

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/

Anabell CC
  • 39
  • 1
  • 7