-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
151 lines (126 loc) · 3.49 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
service: serverless-app
provider:
name: aws
runtime: nodejs20.x
stage: dev
region: eu-central-1
deploymentBucket:
name: sls-app-bucket
iam:
role: arn:aws:iam::019607412348:role/function-with-full-access
configValidationMode: off
plugins:
- serverless-lift
- serverless-openapi-documentation #dev only TODO: remove
- serverless-create-global-dynamodb-table
- serverless-plugin-include-dependencies
- serverless-plugin-common-excludes
package:
individually: true
excludeDevDependencies: false
custom:
globalTables:
version: v2
regions:
- eu-east-1
createStack: false
documentation: ${file(serverless.doc.yml):documentation}
constructs:
deactivated-links-queue:
type: queue
worker:
handler: dist/functions/link/deactivateWithSQS.handler
batchSize: 10
resources:
Resources:
PendingUserTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: pendingUsers
AttributeDefinitions:
- AttributeName: email
AttributeType: S
KeySchema:
- AttributeName: email
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
UserTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: users
AttributeDefinitions:
- AttributeName: email
AttributeType: S
KeySchema:
- AttributeName: email
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
LinkTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: links
AttributeDefinitions:
- AttributeName: alias
AttributeType: S
KeySchema:
- AttributeName: alias
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
functions:
register:
handler: dist/functions/register.handler
events:
- http:
path: auth/register
method: POST
documentation: ${file(serverless.doc.yml):endpoints.register}
login:
handler: dist/functions/login.handler
events:
- http:
path: auth/login
method: POST
documentation: ${file(serverless.doc.yml):endpoints.login}
verify:
handler: dist/functions/verify.handler
events:
- http:
path: auth/verify
method: POST
documentation: ${file(serverless.doc.yml):endpoints.verify}
createLink:
handler: dist/functions/link/createLink.handler
events:
- http:
path: link/createLink
method: POST
documentation: ${file(serverless.doc.yml):endpoints.createLink}
environment:
QUEUE_URL: ${construct:deactivated-links-queue.queueUrl}
deactivateLink:
handler: dist/functions/link/deactivateLink.handler
events:
- http:
path: link/deactivateLink
method: POST
documentation: ${file(serverless.doc.yml):endpoints.deactivateLink}
manageLinks:
handler: dist/functions/link/manageLinks.handler
events:
- http:
path: link/manageLinks
method: POST
documentation: ${file(serverless.doc.yml):endpoints.manageLinks}
useLink:
handler: dist/functions/link/useLink.handler
events:
- http:
path: link/useLink/{alias}
method: POST
documentation: ${file(serverless.doc.yml):endpoints.useLink}