-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml.backup
98 lines (90 loc) · 2.22 KB
/
serverless.yml.backup
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
service: thumbmark-store
frameworkVersion: "3"
provider:
name: aws
region: eu-central-1
runtime: nodejs18.x
stage: ${opt:stage, 'test'}
# lambdaHashingVersion: '20201221'
environment:
DYNAMODB_TABLE: ${self:service}-${sls:stage}
# httpApi:
# cors: true
iam:
role:
statements:
- Effect: Allow
Action:
- dynamodb:Query
# - dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
# - dynamodb:DeleteItem
Resource: "arn:aws:dynamodb:${aws:region}:*:table/${self:provider.environment.DYNAMODB_TABLE}"
plugins:
- serverless-esbuild
- serverless-plugin-typescript
- serverless-dynamodb
- serverless-offline
- serverless-domain-manager
custom:
domain:
test: store-test.thumbmarkjs.com
prod: store.thumbmarkjs.com
dynamodb:
stages:
- test
start:
port: 8000
inMemory: false
migrate: true
customDomain:
domainName: ${self:custom.domain.${self:provider.stage}}
basePath: 'v1'
createRoute53Record: true
stage: ${self:provider.stage}
certificateName: thumbmarkjs.com
functions:
create:
handler: store/create.create
events:
- http:
path: /fingerprint
method: post
cors: true
get:
handler: store/get.get
events:
- http:
path: /fingerprint/{namespace}/{fingerprint}/{key}
method: get
cors: true
test:
handler: store/test.test
events:
- http:
path: /api/test
method: GET
resources:
Resources:
ThumbmarkStoreTable:
Type: 'AWS::DynamoDB::Table'
Properties:
AttributeDefinitions:
- AttributeName: fingerprint
AttributeType: S
- AttributeName: key
AttributeType: S
KeySchema:
- AttributeName: fingerprint
KeyType: HASH
- AttributeName: key
KeyType: RANGE
ProvisionedThroughput:
ReadCapacityUnits: 25
WriteCapacityUnits: 25
TableName: ${self:provider.environment.DYNAMODB_TABLE}
TimeToLiveSpecification:
Enabled: true
AttributeName: expiresAt