-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathtemplate.yaml
executable file
·243 lines (242 loc) · 5.91 KB
/
template.yaml
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
AWSTemplateFormatVersion: 2010-09-09
Description: sam-test-project
Transform:
- AWS::Serverless-2016-10-31
- SlicWatch-v3
Metadata:
slicWatch:
enabled: true
alarmActionsConfig:
alarmActions:
- !Ref MonitoringTopic
okActions:
- !Ref MonitoringTopic
actionsEnabled: true
alarms:
Lambda:
Invocations:
enabled: true
Threshold: 10
SQS:
AgeOfOldestMessage:
Statistic: Maximum
enabled: true
Threshold: 60
InFlightMessagesPc:
Statistic: Maximum
Threshold: 1
Resources:
MonitoringTopic:
Type: AWS::SNS::Topic
Properties:
TopicName: SS-Alarm-Topic3
hello:
Type: AWS::Serverless::Function
Properties:
Handler: basic-handler.hello
Runtime: nodejs18.x
Metadata:
slicWatch:
alarms:
Invocations:
Threshold: 2
ping:
Type: AWS::Serverless::Function
Properties:
Handler: basic-handler.hello
Runtime: nodejs18.x
Metadata:
slicWatch:
dashboard:
enabled: false
throttler:
Type: AWS::Serverless::Function
Properties:
Handler: basic-handler.hello
Runtime: nodejs18.x
ReservedConcurrentExecutions: 0
driveStream:
Type: AWS::Serverless::Function
Properties:
Handler: stream-test-handler.handleDrive
Runtime: nodejs18.x
driveQueue:
Type: AWS::Serverless::Function
Properties:
Handler: basic-handler.hello
Runtime: nodejs18.x
driveTable:
Type: AWS::Serverless::Function
Properties:
Handler: basic-handler.hello
Runtime: nodejs18.x
streamProcessor:
Type: AWS::Serverless::Function
Properties:
Handler: basic-handler.hello
Runtime: nodejs18.x
Events:
Stream:
Type: Kinesis
Properties:
Stream: !GetAtt stream.Arn
MaximumRetryAttempts: 0
StartingPosition: LATEST
httpGetter:
Type: AWS::Serverless::Function
Properties:
Handler: apigw-handler.handleGet
Timeout: 30
Runtime: nodejs18.x
Events:
HttpApiEvent:
Type: HttpApi
Properties:
Path: item
Method: GET
eventsRule:
Type: AWS::Serverless::Function
Properties:
Handler: rule-handler.handleRule
Runtime: nodejs18.x
Events:
Trigger:
Type: CloudWatchEvent
Properties:
Pattern:
detail-type:
- Invoke Lambda Function
RetryPolicy:
MaximumRetryAttempts: 0
MaximumEventAgeInSeconds: 60
Metadata:
slicWatch:
alarms:
enabled: false
TestStateMachine:
Type: AWS::Serverless::StateMachine
Properties:
DefinitionSubstitutions:
HelloArn: !GetAtt hello.Arn
AnotherHelloArn: !GetAtt hello.Arn
Policies:
- LambdaInvokePolicy:
FunctionName: !Ref hello
- LambdaInvokePolicy:
FunctionName: !Ref hello
DefinitionUri: statemachine/test.asl.json
stream:
Type: AWS::Kinesis::Stream
Properties:
ShardCount: 1
regularQueue:
Type: AWS::SQS::Queue
Metadata:
slicWatch:
alarms:
InFlightMessagesPc:
Threshold: 95
dashboard:
ApproximateAgeOfOldestMessage:
yAxis: right
NumberOfMessagesReceived:
enabled: false
fifoQueue:
Type: AWS::SQS::Queue
Properties:
FifoQueue: true
vpc:
Type: AWS::EC2::VPC
Properties:
CidrBlock: 10.0.0.0/16
subnet:
Type: AWS::EC2::Subnet
Properties:
AvailabilityZone: !Select
- 0
- !GetAZs
Ref: AWS::Region
CidrBlock: 10.0.16.0/20
VpcId: !Ref vpc
ecsCluster:
Type: AWS::ECS::Cluster
ecsService:
Type: AWS::ECS::Service
Properties:
Cluster: !Ref ecsCluster
DesiredCount: 0
LaunchType: FARGATE
TaskDefinition: !Ref taskDef
NetworkConfiguration:
AwsvpcConfiguration:
AssignPublicIp: ENABLED
SecurityGroups: []
Subnets:
- !Ref subnet
taskDef:
Type: AWS::ECS::TaskDefinition
Properties:
RequiresCompatibilities:
- FARGATE
Cpu: 256
Memory: 512
ContainerDefinitions:
- Name: busybox
Image: busybox
Cpu: 256
EntryPoint:
- sh
- '-c'
Memory: 512
Command:
- /bin/sh -c "while true; do echo Hello; sleep 10; done"
Essential: true
NetworkMode: awsvpc
dataTable:
Type: AWS::DynamoDB::Table
DeletionPolicy: Delete
Properties:
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
AttributeDefinitions:
- AttributeName: pk
AttributeType: S
- AttributeName: sk
AttributeType: S
- AttributeName: gsi1pk
AttributeType: S
- AttributeName: gsi1sk
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