-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathserverless.yml
70 lines (65 loc) · 1.7 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
service: habit-loop
provider:
name: aws
runtime: nodejs10.x
stage: qa
region: us-east-1
tracing:
lambda: true
environment:
NODE_ENV: ${env:NODE_ENV}
USER_TABLE: ${self:custom.config.USER_TABLE}
REDIS_HOST: ${env:REDIS_HOST}
REDIS_PASSWORD: ${env:REDIS_PASSWORD}
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:UpdateTable
- dynamodb:BatchWriteItem
- dynamodb:DescribeTimeToLive
Resource:
- 'arn:aws:dynamodb:${self:provider.region}:*:table/${self:custom.config.USER_TABLE}'
- 'arn:aws:dynamodb:${self:provider.region}:*:table/${self:custom.config.USER_TABLE}/index/*'
functions:
graphql:
handler: .build/src/app.graphql
events:
- http:
path: graphql
method: post
cors: true
pushNotifications:
handler: .build/src/lib/pushNotifications.handler
events:
- schedule:
name: push-notification-handler
description: 'Sends push notification reminding user to train.'
rate: cron(0 13 * * ? *)
- http:
path: notification
method: get
# order matters here for plugins
plugins:
# - serverless-dynamodb-local
- serverless-offline
- serverless-dotenv-plugin
resources:
- ${file(resources/dynamo/UserTable.yml)}
custom:
config:
USER_TABLE: user-records-${self:provider.stage}
dynamodb:
start:
migrate: false
seed: false
seed:
test:
sources:
- table: user-records-dev-2
sources: [./resources/test_data.json]