I'm trying to deploy an AWS API with serverless.com
When I do:
sls --stage=dev --aws-profile=myprofile deploy --force
I get the following warning:
Configuration warning at 'functions.app.events[0]': unsupported function event
My serverless.yml contains the section:
functions: app: handler: src/index.handler memorySize: 3008 events: - httpApi: method: '*' path: '*' authorizer: name: serviceAuthorizer scopes: # Optional - user.id - user.email
What is wrong with the events section?
The issue is indeed indentation. The indentation on this is weird so I will explain it below. Every ·
is a space:
functions: ··hello: ····handler: handler.hello ····events: ······- http: ··········path: /hello ··········method: get
Some pointers:
- http:
hyphen.Another tip: if you find your text editor is auto-formatting your YAML file and replacing the space indentation with tabs or whatever, add a .editorconfig
file to the root with these settings:
[*.yml] indent_size = 2 indent_style = spaces
I had a similar issue. The problem was with indentation. Try to fix it like this:
- httpApi: method: '*' path: '*'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With