-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless-local-archive-run.yml
100 lines (94 loc) · 2.66 KB
/
serverless-local-archive-run.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
service: dynamodb-logs-local-archive-replay
disabledDeprecations:
- CLI_OPTIONS_SCHEMA
frameworkVersion: ^2.38.0
package:
individually: true
plugins:
- serverless-iam-roles-per-function
provider:
name: aws
deploymentBucket:
blockPublicAccess: true
serverSideEncryption: AES256
logRetentionInDays: 5
tracing:
lambda: true
iam:
role:
statements:
- Effect: Allow
Action:
- xray:PutTelemetryRecords
- xray:PutTraceSegments
Resource: "*"
lambdaHashingVersion: 20201221
environment:
AWS_NODEJS_CONNECTION_REUSE_ENABLED: 1
eventBridge:
useCloudFormation: true
tags:
commit: "${env:COMMIT_ID}"
functions:
websocket:
handler: src/websocket.handler
runtime: nodejs14.x
timeout: 6
memorySize: 128
package:
patterns:
- "!./**"
- "./src/websocket.js"
environment:
allowed_ip: "${env:external_ip4_address}"
DYNAMODB_TABLE: "${opt:stage, 'local'}-dynamodb-logs"
stage: "${opt:stage, 'local'}"
events:
- websocket:
route: $connect
- websocket:
route: $disconnect
iamRoleStatementsName: "dynamodb-logs-local-archive-replay-${opt:stage, 'local'}-websocket"
iamRoleStatements:
- Effect: Allow
Action:
- "dynamodb:PutItem"
- "dynamodb:DeleteItem"
- "dynamodb:Query"
Resource:
- !Sub "arn:${AWS::Partition}:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${opt:stage, 'local'}-dynamodb-logs"
iamRoleStatementsInherit: true
localReplay:
handler: src/local-replay.handler
runtime: nodejs14.x
timeout: 6
memorySize: 128
package:
patterns:
- "!./**"
- "./src/local-replay.js"
environment:
DYNAMODB_TABLE: "${opt:stage, 'local'}-dynamodb-logs"
iamRoleStatementsName: "dynamodb-logs-local-archive-replay-${opt:stage, 'local'}-local-replay"
iamRoleStatements:
- Effect: Allow
Action:
- "dynamodb:Query"
Resource:
- !Sub "arn:${AWS::Partition}:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${opt:stage, 'local'}-dynamodb-logs"
- Effect: Allow
Action:
- "execute-api:ManageConnections"
Resource:
- !Sub "arn:${AWS::Partition}:execute-api:${AWS::Region}:${AWS::AccountId}:**/@connections/*"
iamRoleStatementsInherit: true
events:
- eventBridge:
eventBus: ${cf:dynamodb-logs-${opt:stage, 'local'}.eventBusArn}
pattern:
source:
- "dynamodb-log"
detail-type:
- "stream changes"
replay-name:
- exists: true