1 of 20

Serverless Gotchas

Anna Doubkova - @lithinn

Dev @ Hive

2 of 20

3 of 20

Hardware

API

Apps

Experiential layer

Experiential layer

4 of 20

?

SLS 0.5

SLS 1

5 of 20

1) How large can it get really?

6 of 20

1) How large can it get really?

Large.

Resources

Policies

Config

File size

7 of 20

200

resources

8 of 20

10MB

Policy file size

9 of 20

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!

10 of 20

23MB

Average function file size

11 of 20

Serverless.yml

custom:

webpack: ./webpack.sls1.config.js

package:

individually: true

12 of 20

400 lines

Config in serverless.yml

13 of 20

(main) Serverless.yml

functions:

DevicesGet: ${file(./path-to-fn/serverless.yml)}

14 of 20

(local) Serverless.yml

handler: path-to-fn/handler.handler

events:

- http:

path: devices/{id}

method: get

cors: true

15 of 20

2) Debugging with front-end app

16 of 20

2) Debugging with front-end App

Spin it all up.

Express to lambda

Uses 0.5 definitions

17 of 20

Is it worth it?

18 of 20

YES!

19 of 20

Thank you!

Anna Doubkova - @lithinn

20 of 20

We’re hiring!

http://bit.ly/work-at-hive