Serverless Gotchas
Anna Doubkova - @lithinn
Dev @ Hive
Hardware
API
Apps
Experiential layer
Experiential layer
?
SLS 0.5
SLS 1
1) How large can it get really?
1) How large can it get really?
Large.
Resources
Policies
Config
File size
200
resources
10MB
Policy file size
Serverless.yml
plugins:
- serverless-plugin-custom-roles
- serverless-plugin-split-stacks
Stacks-map.JS
const stacksMap = require('serverless-plugin-split-stacks').stacksMap;
stacksMap['AWS::IAM::Role'] = { destination: 'Roles' };
Big thanks to @dougmoscrop!
23MB
Average function file size
Serverless.yml
custom:
webpack: ./webpack.sls1.config.js
package:
individually: true
400 lines
Config in serverless.yml
(main) Serverless.yml
functions:
DevicesGet: ${file(./path-to-fn/serverless.yml)}
(local) Serverless.yml
handler: path-to-fn/handler.handler
events:
- http:
path: devices/{id}
method: get
cors: true
2) Debugging with front-end app
2) Debugging with front-end App
Spin it all up.
Express to lambda
Uses 0.5 definitions
Is it worth it?
YES!
Thank you!
Anna Doubkova - @lithinn
We’re hiring!
http://bit.ly/work-at-hive