-
Notifications
You must be signed in to change notification settings - Fork 1
/
lambda.template.yaml
189 lines (180 loc) · 6.2 KB
/
lambda.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
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Description: >
tacostats v1.5.4
periodically grab comments from the r/neoliberal DT and gather some basic statistics
# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst
Globals:
Function:
Timeout: 900
Resources:
###############
# Harvester
###############
Harvester:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
PackageType: Image
MemorySize: 256
ImageUri: 390721581096.dkr.ecr.us-east-2.amazonaws.com/tacostats:v1.5.4
ImageConfig:
Command:
- tacostats.harvester.lambda_handler
Role: arn:aws:iam::390721581096:role/tacostats
Events:
Cron:
Type: Schedule
Properties:
Schedule: cron(55/30 * * * ? *)
Enabled: True
Metadata:
Dockerfile: lambda.Dockerfile
DockerContext: "."
# post a recap of yesterday's stats in the morning
HarvesterRecap:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
PackageType: Image
MemorySize: 256
ImageUri: 390721581096.dkr.ecr.us-east-2.amazonaws.com/tacostats:v1.5.4
ImageConfig:
Command:
- tacostats.harvester.lambda_handler
Environment:
Variables:
RECAP: True
Role: arn:aws:iam::390721581096:role/tacostats
Events:
Cron:
Type: Schedule
Properties:
Schedule: cron(0 7 * * ? *)
Enabled: True
Metadata:
Dockerfile: lambda.Dockerfile
DockerContext: "."
###############
# Statistics
###############
Stats:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
PackageType: Image
MemorySize: 256
ImageUri: 390721581096.dkr.ecr.us-east-2.amazonaws.com/tacostats:v1.5.4
ImageConfig:
Command:
- tacostats.stats.lambda_handler
Role: arn:aws:iam::390721581096:role/tacostats
Environment:
Variables:
USE_EXISTING: True
Events:
# schedules in utc, et equivs: 12,16,21
Cron:
Type: Schedule
Properties:
Schedule: cron(0 16,22,1 * * ? *)
Enabled: True
Metadata:
Dockerfile: lambda.Dockerfile
DockerContext: "."
# post a recap of yesterday's stats in the morning
StatsRecap:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
PackageType: Image
MemorySize: 256
ImageUri: 390721581096.dkr.ecr.us-east-2.amazonaws.com/tacostats:v1.5.4
ImageConfig:
Command:
- tacostats.stats.lambda_handler
Environment:
Variables:
RECAP: True
USE_EXISTING: True
Role: arn:aws:iam::390721581096:role/tacostats
Events:
# schedules in utc, 9et
Cron:
Type: Schedule
Properties:
Schedule: cron(0 13 * * ? *)
Enabled: True
Metadata:
Dockerfile: lambda.Dockerfile
DockerContext: "."
###############
# Keywords
###############
Keywords:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
PackageType: Image
MemorySize: 384
ImageUri: 390721581096.dkr.ecr.us-east-2.amazonaws.com/tacostats:v1.5.4
ImageConfig:
Command:
- tacostats.keywords.lambda_handler
Environment:
Variables:
USE_EXISTING: True
Role: arn:aws:iam::390721581096:role/tacostats
Events:
Cron:
Type: Schedule
Properties:
Schedule: cron(20 20 * * ? *) # et equiv: 16:20
Enabled: True
Metadata:
Dockerfile: lambda.Dockerfile
DockerContext: "."
# post a recap of yesterday's keywords in the morning
KeywordsRecap:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
PackageType: Image
MemorySize: 384
ImageUri: 390721581096.dkr.ecr.us-east-2.amazonaws.com/tacostats:v1.5.4
ImageConfig:
Command:
- tacostats.keywords.lambda_handler
Environment:
Variables:
RECAP: True
USE_EXISTING: True
Role: arn:aws:iam::390721581096:role/tacostats
Events:
# schedules in utc, 10et
Cron:
Type: Schedule
Properties:
Schedule: cron(0 14 * * ? *)
Enabled: True
Metadata:
Dockerfile: lambda.Dockerfile
DockerContext: "."
###############
# UserStats
###############
UserStats:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
Timeout: 300
PackageType: Image
MemorySize: 512
ImageUri: 390721581096.dkr.ecr.us-east-2.amazonaws.com/tacostats:v1.5.4
ImageConfig:
Command:
- tacostats.userstats.lambda_handler
Role: arn:aws:iam::390721581096:role/tacostats
Events:
Queue:
Type: SQS
Properties:
Queue: arn:aws:sqs:us-east-2:390721581096:tacostats-pinger
BatchSize: 10
Enabled: true
Metadata:
Dockerfile: lambda.Dockerfile
DockerContext: "."