-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathserverless.yml
184 lines (179 loc) · 4.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
service:
name: PersonalHealthDashboard
# Add the serverless-webpack plugin
plugins:
- serverless-webpack
- serverless-offline
# Pool Id eu-west-2_hwda35xPV
# Pool ARN arn:aws:cognito-idp:eu-west-2:552281511161:userpool/eu-west-2_hwda35xPV
# App client ID 6b85ma6aotsan5p8l8g8evsi3
# Domain https://phd.auth.eu-west-2.amazoncognito.com
# Identity Pool ID eu-west-2:3bad1577-1fcd-47bb-83d5-419fd552d7d7
# API client ID
provider:
name: aws
region: eu-west-2
stage: prod
runtime: nodejs8.10
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:DescribeTable
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource:
- "arn:aws:dynamodb:eu-west-2:*:*"
- Effect: Allow
Action:
- ssm:GetParameter
Resource:
- 'Fn::Join':
- ':'
- - 'arn:aws:ssm'
- Ref: 'AWS::Region'
- Ref: 'AWS::AccountId'
- 'parameter/gc_password'
custom:
webpack:
webpackConfig: ./webpack.config.js
includeModules: true
resources:
Resources:
maxhr:
Type: AWS::DynamoDB::Table
Properties:
TableName: "maxhr"
AttributeDefinitions:
- AttributeName: "date"
AttributeType: "S"
KeySchema:
- AttributeName: "date"
KeyType: "HASH"
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
distance:
Type: AWS::DynamoDB::Table
Properties:
TableName: "distance"
AttributeDefinitions:
- AttributeName: "date"
AttributeType: "S"
KeySchema:
- AttributeName: "date"
KeyType: "HASH"
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
duration:
Type: AWS::DynamoDB::Table
Properties:
TableName: "duration"
AttributeDefinitions:
- AttributeName: "date"
AttributeType: "S"
KeySchema:
- AttributeName: "date"
KeyType: "HASH"
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
steps:
Type: AWS::DynamoDB::Table
Properties:
TableName: "steps"
AttributeDefinitions:
- AttributeName: "date"
AttributeType: "S"
KeySchema:
- AttributeName: "date"
KeyType: "HASH"
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
wellness:
Type: AWS::DynamoDB::Table
Properties:
TableName: "wellness"
AttributeDefinitions:
- AttributeName: "date"
AttributeType: "S"
KeySchema:
- AttributeName: "date"
KeyType: "HASH"
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
functions:
heartrate:
handler: serverless/handler.heartRate
events:
- schedule: rate(30 minutes)
resthr:
handler: serverless/handler.restHr
events:
- schedule: rate(30 minutes)
distance:
handler: serverless/handler.distance
events:
- schedule: rate(30 minutes)
duration:
handler: serverless/handler.duration
events:
- schedule: rate(30 minutes)
steps:
handler: serverless/handler.steps
events:
- schedule: rate(30 minutes)
sleep:
handler: serverless/handler.sleep
events:
- schedule: rate(30 minutes)
stress:
handler: serverless/handler.stress
events:
- schedule: rate(30 minutes)
api-heartrate:
handler: serverless/api.heartrate
events:
- http:
path: heartrate
method: get
cors: true
authorizer: aws_iam
api-distance:
handler: serverless/api.distance
events:
- http:
path: distance
method: get
cors: true
authorizer: aws_iam
api-duration:
handler: serverless/api.duration
events:
- http:
path: duration
method: get
cors: true
authorizer: aws_iam
api-steps:
handler: serverless/api.steps
events:
- http:
path: steps
method: get
cors: true
authorizer: aws_iam
api-wellness:
handler: serverless/api.wellness
events:
- http:
path: wellness
method: get
cors: true
authorizer: aws_iam