-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
142 lines (126 loc) · 2.68 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
service: blackfriday
frameworkVersion: '2'
useDotenv: true
plugins:
- serverless-bundle
- serverless-domain-manager
provider:
name: aws
runtime: nodejs14.x
region: eu-west-2
stage: production
versionFunctions: false
iam:
role:
statements:
- Effect: 'Allow'
Action:
- dynamodb:PutItem
Resource:
- Fn::GetAtt:
- scoreTable
- Arn
- Effect: 'Allow'
Action:
- dynamodb:Scan
Resource:
- Fn::GetAtt:
- scoreTable
- Arn
Condition:
ForAllValues:StringEquals:
dynamodb:Attributes:
- handle
- score
- id
httpApi:
cors:
allowedOrigins:
- '*'
allowedMethods:
- GET
- POST
environment:
SCORE_TABLE: ${self:custom.tableNames.scoreTable}
functions:
statichttp:
handler: staticHandler.pageHandler
events:
- httpApi:
path: /
method: GET
- httpApi:
path: /{any+}
method: GET
play:
handler: index.play
timeout: 12
events:
- httpApi:
path: /
method: POST
scoreboard:
handler: scoreboard.scoreboard
timeout: 12
events:
- httpApi:
path: /scoreboard
method: GET
package:
include:
- 'docs/**'
exclude:
- 'tests/**'
- '*.md'
- 'wallaby.js'
- 'jest.config.js'
- 'package-lock.json'
# - "node_modules/aws-sdk/**"
- 'coverage/**'
- '.*'
- '.*/**'
resources:
Resources:
scoreTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: ${self:custom.tableNames.scoreTable}
KeySchema:
- AttributeName: id
KeyType: HASH
- AttributeName: score
KeyType: RANGE
AttributeDefinitions:
- AttributeName: id
AttributeType: S
- AttributeName: score
AttributeType: 'N'
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 2
custom:
bundle:
linting: false
# caching: false
sourcemaps: false
copyFiles:
- from: 'docs/*'
to: './'
dynamodb:
noStart: true
tableNames:
scoreTable: blackFridayScoreTable
stages:
- production
start:
migrate: true
customDomain:
domainName: blackfriday.sa-team.teams.kore.appvia.io
stage: production
basePath: ""
certificateName: sa-team.teams.kore.appvia.io
createRoute53Record: true
endpointType: 'regional'
securityPolicy: tls_1_2
apiType: http
autoDomain: false