This repository was archived by the owner on Sep 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverless.yml
More file actions
119 lines (107 loc) · 3.14 KB
/
serverless.yml
File metadata and controls
119 lines (107 loc) · 3.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
service: skore-serverless-test
frameworkVersion: ">=1.1.0 <2.0.0"
custom:
bucket: ${self:service}
provider:
name: aws
runtime: nodejs8.10
region: sa-east-1
environment:
DYNAMODB_TABLE: ${self:service}-${opt:stage, self:provider.stage}
DYNAMODB_SYNC_OPS: ${self:service}-sync-ops
DYNAMODB_CONTENT_CONSUMPTION: ${self:service}-content-consumption
UPLOAD_MAX_BATCH_SIZE: 1000
role: arn:aws:iam::537860298710:role/skore-serverless-test-dev-sa-east-1-lambdaRole
resources:
Resources:
SyncOpsDynamoDbTable:
Type: 'AWS::DynamoDB::Table'
DeletionPolicy: Retain
Properties:
TableName: ${self:provider.environment.DYNAMODB_SYNC_OPS}
AttributeDefinitions:
- AttributeName: customer_id
AttributeType: S
- AttributeName: file_id
AttributeType: S
KeySchema:
- AttributeName: customer_id
KeyType: HASH
- AttributeName: file_id
KeyType: RANGE
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
StreamSpecification:
StreamViewType: NEW_AND_OLD_IMAGES
ContentConsumptionDynamoDbTable:
Type: 'AWS::DynamoDB::Table'
DeletionPolicy: Retain
Properties:
TableName: ${self:provider.environment.DYNAMODB_CONTENT_CONSUMPTION}
BillingMode: PAY_PER_REQUEST
AttributeDefinitions:
- AttributeName: customer_id
AttributeType: S
- AttributeName: user_id
AttributeType: S
- AttributeName: count_
AttributeType: N
KeySchema:
- AttributeName: customer_id
KeyType: HASH
- AttributeName: user_id
KeyType: RANGE
LocalSecondaryIndexes:
- IndexName: count-index
KeySchema:
- AttributeName: customer_id
KeyType: HASH
- AttributeName: count_
KeyType: RANGE
Projection:
ProjectionType: ALL
functions:
authorizer:
handler: authorizer/index.handler
trigger-upload-s3:
timeout: 30
memorySize: 1024
handler: triggers/upload-s3/index.handler
events:
- s3:
bucket: ${self:custom.bucket}
event: s3:ObjectCreated:*
rules:
- prefix: content-consumption-files/
- suffix: .csv
trigger-upload-from-dynamodb:
timeout: 30
memorySize: 512
handler: triggers/upload-dynamodb/index.handler
exclude:
- .test.js
events:
- stream:
arn: arn:aws:dynamodb:sa-east-1:537860298710:table/skore-serverless-test-sync-ops/stream/2019-02-12T02:57:46.741
batchSize: 1
startingPosition: LATEST
enabled: true
resource-upload-status-list:
timeout: 6
memorySize: 1024
handler: api-resources/upload-status/list.handler
events:
- http:
path: upload-status
method: get
cors: true
resource-user-consumption-list:
timeout: 6
memorySize: 1024
handler: api-resources/user-consumption/list.handler
events:
- http:
path: user-consumption
method: get
cors: true