-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
119 lines (110 loc) · 2.99 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
org: neagle
app: ptolemy
service: ptolemy
frameworkVersion: '3'
useDotenv: true
provider:
name: aws
runtime: nodejs14.x
profile: decipher-serverless
region: us-east-1
timeout: 30
environment:
BOT_USER_OAUTH_TOKEN: ${param:BOT_USER_OAUTH_TOKEN}
CALENDAR_ID: ${param:CALENDAR_ID}
package:
individually: true
patterns:
- auth/**
functions:
announcer:
handler: src/handlers/announcer.handler
description: Make announcements to Slack channels
events:
# Minutes Hours Day-of-month Month Day-of-week Year
# Don't assume AWS ScheduleExpressions map directly to normal cron!
# @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html
# Every Monday, let general know who's out this week
- schedule:
rate: cron(0 14 ? * MON *)
enabled: true
input:
command: 'out'
args: 'this week'
channels: 'general'
# Every Friday, let general know who's out NEXT week
- schedule:
rate: cron(1 14 ? * FRI *)
enabled: true
input:
command: 'out'
args: 'next week'
channels: 'general'
responder:
handler: src/handlers/responder.handler
description: Respond to Slack events
events:
- http:
method: post
path: '/ptolemy/responder'
cors:
origin: '*'
headers:
- Content-Type
- X-Amz-Date
- Authorization
- X-Api-Key
- X-Amz-Security-Token
- x-itcom-clientid
allowCredentials: false
pto:
handler: src/handlers/pto.handler
description: Add PTO to the calendar
events:
- http:
method: post
path: '/ptolemy/pto'
cors:
origin: '*'
headers:
- Content-Type
- X-Amz-Date
- Authorization
- X-Api-Key
- X-Amz-Security-Token
- x-itcom-clientid
allowCredentials: false
interactive:
handler: src/handlers/interactive.handler
description: Handle interactive components
events:
- http:
method: post
path: '/ptolemy/interactive'
cors:
origin: '*'
headers:
- Content-Type
- X-Amz-Date
- Authorization
- X-Api-Key
- X-Amz-Security-Token
- x-itcom-clientid
allowCredentials: false
out:
handler: src/handlers/slashCommands.handler
description: Receive outgoing request from Slack
events:
- http:
method: post
path: '/ptolemy/out'
cors:
origin: '*'
headers:
- Content-Type
- X-Amz-Date
- Authorization
- X-Api-Key
- X-Amz-Security-Token
- x-itcom-clientid
allowCredentials: false