-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverless.yml
More file actions
170 lines (162 loc) · 3.75 KB
/
Copy pathserverless.yml
File metadata and controls
170 lines (162 loc) · 3.75 KB
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
service: starship-compiler
frameworkVersion: '3'
useDotenv: true
plugins:
- serverless-dynamodb-local
- serverless-offline
custom:
serverless-offline:
httpPort: 3333
dynamodb:
stages:
- dev
start:
inMemory: false
migrate: true
port: 8000
provider:
name: aws
region: eu-west-3
runtime: nodejs14.x
memorySize: 2048
timeout: 50
environment:
AUTH0_CLIENT_ID: ${env:AUTH0_CLIENT_ID}
AUTH0_CLIENT_SECRET: ${env:AUTH0_CLIENT_SECRET}
httpApi:
cors: true
iam:
role:
statements:
- Effect: Allow
Resource: '*'
Action:
- s3:*
- dynamodb:*
functions:
profile:
handler: src/handlers/profile.profile
events:
- httpApi:
path: /user/{username}
method: get
sync:
handler: src/handlers/sync.sync
events:
- httpApi:
path: /data/sync
method: post
fetchData:
handler: src/handlers/sync.fetch
events:
- httpApi:
path: /data/fetch
method: get
compile:
handler: src/handlers/compile.compile
events:
- httpApi:
path: /compile
method: post
ai:
handler: src/handlers/compile.get
events:
- httpApi:
path: /ai
method: get
skirmishes-save:
handler: src/handlers/skirmishes.save
events:
- httpApi:
path: /skirmishes
method: post
skirmishes-fight:
handler: src/handlers/skirmishes.fight
events:
- httpApi:
path: /skirmishes/{username}
method: get
stats-save:
handler: src/handlers/stats.save
events:
- httpApi:
path: /stats
method: post
stats-get:
handler: src/handlers/stats.get
events:
- httpApi:
path: /stats
method: get
resources:
Resources:
# Save the state of the app
usersTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: preferences
AttributeDefinitions:
- AttributeName: username
AttributeType: S
KeySchema:
- AttributeName: username
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
# Save the skirmishes configurations
skirmishTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: skirmishes
AttributeDefinitions:
- AttributeName: username
AttributeType: S
KeySchema:
- AttributeName: username
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
# Save the fight stats
statsTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: stats
AttributeDefinitions:
- AttributeName: username
AttributeType: S
KeySchema:
- AttributeName: username
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
# Save the fight stats
fleetConfigsTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: fleetConfigs
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
# Save the AI
aisTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: ais
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1