forked from fourTheorem/slic-watch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
189 lines (170 loc) · 4.41 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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
service: serverless-test-project
frameworkVersion: "2"
configValidationMode: error
variablesResolutionMode: 20210219
plugins:
- serverless-step-functions
- serverless-slic-watch-plugin
custom:
slicWatch:
topicArn: ${env:ALARM_TOPIC}
alarms:
Lambda:
Invocations:
enabled: true
Threshold: 10
SQS:
AgeOfOldestMessage:
Statistic: Maximum
enabled: true
Threshold: 60
InFlightMessagesPc:
Statistic: Maximum
Threshold: 1 # 1% = 1200 for regular queues or 180 for FIFO queues
provider:
name: aws
runtime: nodejs12.x
lambdaHashingVersion: 20201221
region: eu-west-1
endpointType: REGIONAL
functions:
hello:
handler: basic-handler.hello
slicWatch:
alarms:
Lambda:
Invocations:
Threshold: 2
ping:
handler: basic-handler.hello
slicWatch:
dashboard:
enabled: false
throttler:
handler: basic-handler.hello
reservedConcurrency: 0
driveStream:
handler: stream-test-handler.handleDrive
environment:
STREAM_NAME: { "Ref": stream }
driveQueue:
handler: queue-test-handler.handleDrive
driveTable:
handler: table-test-hander.handleDrive
streamProcessor:
handler: stream-handler.handle
events:
- stream:
type: kinesis
arn: { "Fn::GetAtt": [stream, Arn] }
startingPosition: LATEST
maximumRetryAttempts: 0
httpGetter:
handler: apigw-handler.handleGet
timeout: 30
events:
- http:
method: get
path: "item"
resources:
Resources:
stream:
Type: AWS::Kinesis::Stream
Properties:
Name: awesome-savage-stream
ShardCount: 1
bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: awesome-savage-bucket
dataTable:
Type: AWS::DynamoDB::Table
DeletionPolicy: Delete
Properties:
TableName: MyTable
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
AttributeDefinitions:
- AttributeName: pk
AttributeType: S
- AttributeName: sk
AttributeType: S
- AttributeName: gsi1pk
AttributeType: S
- AttributeName: gsi1sk
AttributeType: S
- AttributeName: field1
AttributeType: S
- AttributeName: field2
AttributeType: S
- AttributeName: timestamp
AttributeType: N
KeySchema:
- AttributeName: pk
KeyType: HASH
- AttributeName: sk
KeyType: RANGE
GlobalSecondaryIndexes:
- IndexName: GSI1
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
KeySchema:
- AttributeName: gsi1pk
KeyType: HASH
- AttributeName: gsi1sk
KeyType: RANGE
Projection:
NonKeyAttributes:
- address
ProjectionType: INCLUDE
LocalSecondaryIndexes:
- IndexName: LSI1
KeySchema:
- AttributeName: pk
KeyType: HASH
- AttributeName: timestamp
KeyType: RANGE
Projection:
NonKeyAttributes:
- name
ProjectionType: INCLUDE
regularQueue:
Type: "AWS::SQS::Queue"
Properties:
QueueName: "SomeRegularQueue"
fifoQueue:
Type: "AWS::SQS::Queue"
Properties:
QueueName: "SomeFifoQueue.fifo"
FifoQueue: true
workflowLogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: WorkflowLogs
RetentionInDays: 1
expressWorkflowLogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: ExpressWorkflowLogs
RetentionInDays: 1
stepFunctions:
stateMachines:
workflow:
name: Workflow
definition: ${file(./state-machine.yml)}
loggingConfig:
level: ALL
includeExecutionData: true
destinations:
- Fn::GetAtt: [workflowLogGroup, Arn]
expressWorkflow:
name: ExpressWorkflow
type: EXPRESS
definition: ${file(./state-machine.yml)}
loggingConfig:
level: ALL
includeExecutionData: true
destinations:
- Fn::GetAtt: [expressWorkflowLogGroup, Arn]