-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathserverless.yml
More file actions
167 lines (160 loc) · 4.14 KB
/
serverless.yml
File metadata and controls
167 lines (160 loc) · 4.14 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
service: serverless-dynamo-basic-operations
plugins:
- serverless-dynamodb-local
custom:
myStage: ${opt:stage, self:provider.stage}
dynamodb:
stages:
- dev
dev:
ENTITIES_DYNAMODB_TABLE: MoD-entities-dev
start:
sharedDb: true
inMemory: false
dbPath: ./dbData
seed:
mainTables:
sources:
- table: items
sources: [./DiscordBot/schemas/items.json]
- table: rooms
sources: [./DiscordBot/schemas/rooms.json]
- table: players
sources: [./DiscordBot/schemas/players.json]
- table: npcs
sources: [./DiscordBot/schemas/npcs.json]
- table: enemies
sources: [./DiscordBot/schemas/enemies.json]
- table: statusEffects
sources: [./DiscordBot/schemas/statusEffects.json]
provider:
name: aws
runtime: nodejs6.10
profile: default
region: us-east-1
environment: ${self:custom.dynamodb.${self:custom.myStage}}
iamRoleStatements:
- Effect: "Allow"
Action:
- "dynamodb:GetItem"
- "dynamodb:PutItem"
- "dynamodb:UpdateItem"
- "dynamodb:DeleteItem"
functions:
saveItem:
handler: handler.saveItem
events:
- http:
path: item
method: post
getItem:
handler: handler.getItem
events:
- http:
path: item/{itemId}
method: get
deleteItem:
handler: handler.deleteItem
events:
- http:
path: item/{itemId}
method: delete
updateItem:
handler: handler.updateItem
events:
- http:
path: item/{itemId}
method: put
resources:
Resources:
MudTestTable:
Type: AWS::DynamoDB::Table
Properties:
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
TableName: ${self:custom.dynamodb.${self:custom.myStage}.ENTITIES_DYNAMODB_TABLE}
itemTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: items
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
roomTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: rooms
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
playerTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: players
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
npcTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: npcs
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
enemyTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: enemies
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
statusEffectsTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: statusEffects
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1