-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
71 lines (67 loc) · 1.67 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
70
71
service: socket
provider:
name: aws
runtime: nodejs12.x
stage: ${opt:stage, 'prod'}
timeout: 25
region: eu-west-1
apiGateway:
shouldStartNameWithService: true
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:*
Resource:
- ${ssm:/echo/ddb/podcasts/arn}
- ${ssm:/echo/ddb/episodes/arn}
- ${ssm:/echo/ddb/notifications/arn}
- ${ssm:/echo/ddb/users/arn}
- ${ssm:/echo/ddb/playback/arn}
- Effect: Allow
Action:
- execute-api:Invoke
Resource:
- arn:aws:execute-api:eu-west-1:818838602878:0li5bdn7tg/*
environment:
stage: ${self:provider.stage}
PI_API_KEY: ${ssm:/echo/pi/key}
PI_API_SECRET: ${ssm:/echo/pi/secret~true}
PUBLIC_KEY: ${ssm:/echo/api/PublicKey}
VAPID_PUBLIC: ${ssm:/echo/webpush/key/public}
VAPID_PRIVATE: ${ssm:/echo/webpush/key/private~true}
functions:
socket:
handler: src/api.socket
events:
- websocket:
route: $connect
- websocket:
route: $disconnect
- websocket:
route: $default
episode:
handler: src/episode/index.episode
events:
- stream:
type: dynamodb
arn: ${ssm:/echo/ddb/episodes/streamarn}
batchSize: 2000
batchWindow: 1
maximumRetryAttempts: 2
push:
handler: src/push.handler
events:
- sns:
arn: ${ssm:/echo/sns/clientpush/arn}
maximumRetryAttempts: 0
plugins:
- serverless-webpack
- serverless-offline
custom:
serverless-offline:
lambdaPort: 3005
noPrependStageInUrl: true
webpack:
webpackConfig: 'webpack.config.js'
packager: 'npm'
includeModules: true