-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
69 lines (63 loc) · 1.47 KB
/
serverless.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
service: kebetoo-services
provider:
name: aws
runtime: nodejs12.x
timeout: ${self:custom.lambdaTimeout}
lambdaHashingVersion: 20201221
logRetentionInDays: ${self:custom.logRetentionInDays}
apiGateway:
shouldStartNameWithService: true
region: ${env:REGION, 'eu-west-3'}
iamRoleStatements:
- Effect: Allow
Action:
- s3:PutObject
- s3:GetObject
Resource: "arn:aws:s3:::${self:custom.bucket}/*"
functions:
notifications:
handler: services/notifications/handler.create
events:
- http:
path: notifications
method: POST
ranking:
handler: services/ranking/handler.rank
events:
- schedule: rate(${self:custom.ranking_rate})
thumbnail:
handler: services/thumbnail/handler.generate
events:
- s3:
bucket: ${self:custom.bucket}
event: s3:ObjectCreated:*
existing: true
layers:
- {Ref: FfmpegLambdaLayer}
layers:
ffmpeg:
path: layer
plugins:
- serverless-s3-local
- serverless-offline
- serverless-dotenv-plugin
custom:
serverless-offline:
host: localhost
directory: ${file(./serverless.yml.js):path}/tmp/buckets
dotenv:
required:
file: true
bucket: ${env:S3_BUCKET, 'kebetoo'}
ranking_rate: ${env:RANKING_RATE, '5 minutes'}
lambdaTimeout: 60
logRetentionInDays: 30
package:
exclude:
- tmp/**
- README.md
- husky.config.js
- commitlint.config.js
- .gitattributes
- .eslintrc.js
- .env.*