-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathserverless.yml
More file actions
131 lines (123 loc) · 3.29 KB
/
serverless.yml
File metadata and controls
131 lines (123 loc) · 3.29 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
120
121
122
123
124
125
126
127
128
129
130
131
service: ucla-registrar-scraper
useDotenv: true
provider:
name: aws
runtime: provided.al2
architecture: arm64
timeout: 120
region: 'us-west-1'
versionFunctions: false
iam:
role:
statements:
- Effect: Allow
Action:
- lambda:InvokeFunction
- lambda:InvokeAsync
- xray:PutTraceSegments
- xray:PutTelemetryRecords
Resource: '*'
tracing:
lambda: true
environment:
LOGGING: ${env:LOGGING, ''}
LOG_LEVEL: ${env:LOG_LEVEL, 'warn'}
DATABASE_URL: ${env:DATABASE_URL, ''}
BATCH_SIZE: ${env:BATCH_SIZE, 200}
MAX_GOROUTINES: ${env:MAX_GOROUTINES, 20}
DD_FLUSH_TO_LOG: ${env:DD_FLUSH_TO_LOG, false}
DD_TRACE_ENABLED: ${env:DD_TRACE_ENABLED, false}
DD_MERGE_XRAY_TRACES: ${env:DD_MERGE_XRAY_TRACES, false}
DRY_RUN: ${env:DRY_RUN, true}
USE_PREPARED_STATEMENTS: ${env:USE_PREPARED_STATEMENTS, false}
LAMBDA_INVOKE_DELAY_MS: ${env:LAMBDA_INVOKE_DELAY_MS, 50}
NOTIFICATION_ENDPOINT: ${env:NOTIFICATION_ENDPOINT, ''}
NOTIFICATION_ENDPOINT_TOKEN: ${env:NOTIFICATION_ENDPOINT_TOKEN, ''}
package:
individually: true
patterns:
- '!./**'
- './bin/**'
custom:
# Payloads
currentTerm:
term:
term: '25W'
id: 79
shouldInsertEnrollmentData: true
# summerTerm:
# term:
# term: '231'
# id: 112
# shouldInsertEnrollmentData: true
functions:
FetchSubjectAreas:
name: fetch-subject-areas
handler: bootstrap
package:
artifact: bin/fetch-subject-areas.zip
events:
# Top of every month at 11:15pm UTC
- schedule:
rate: cron(15 23 1 * ? *)
input: ${self:custom.currentTerm}
# - schedule:
# rate: cron(15 23 1 * ? *)
# input: ${self:custom.summerTerm}
FetchCourses:
name: fetch-courses
handler: bootstrap
package:
artifact: bin/fetch-courses.zip
events:
# Every day at 11:45pm UTC
- schedule:
rate: cron(45 23 * * ? *)
input: ${self:custom.currentTerm}
# Every day at 11:50pm UTC
# - schedule:
# rate: cron(50 23 * * ? *)
# input: ${self:custom.summerTerm}
FetchSections:
name: fetch-sections
handler: bootstrap
package:
artifact: bin/fetch-sections.zip
timeout: 420 # 7 minutes
events:
# Every hour at XX:25
- schedule:
rate: cron(25 * * * ? *)
input: ${self:custom.currentTerm}
# Every hour at XX:35
# - schedule:
# rate: cron(35 * * * ? *)
# input: ${self:custom.summerTerm}
FetchCourseDescriptions:
name: fetch-course-descriptions
handler: bootstrap
package:
artifact: bin/fetch-course-descriptions.zip
events:
# Top of every month at 11:40pm UTC
- schedule:
rate: cron(40 23 1 * ? *)
input: {}
resources:
Resources:
FetchSubjectAreasLogGroup:
Type: 'AWS::Logs::LogGroup'
Properties:
RetentionInDays: 7
FetchCoursesLogGroup:
Type: 'AWS::Logs::LogGroup'
Properties:
RetentionInDays: 7
FetchSectionsLogGroup:
Type: 'AWS::Logs::LogGroup'
Properties:
RetentionInDays: 7
FetchCourseDescriptionsLogGroup:
Type: 'AWS::Logs::LogGroup'
Properties:
RetentionInDays: 7