-
Notifications
You must be signed in to change notification settings - Fork 1
/
serverless.yml
60 lines (55 loc) · 1.32 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
service: calendar-formatter
frameworkVersion: '2'
provider:
name: aws
lambdaHashingVersion: 20201221
runtime: nodejs14.x
stage: dev
region: eu-central-1
timeout: 20
iam:
role:
statements:
- Effect: "Allow"
Action:
- s3:*
- lambda:InvokeFunction
Resource: "*"
environment:
REGION: ${opt:region, self:provider.region}
BUCKET: ${self:custom.bucket}
BOT_TOKEN: ${env:BOT_TOKEN, file(./secrets/secrets.json):BOT_TOKEN}
CHAT_ID: ${env:CHAT_ID, file(./secrets/secrets.json):CHAT_ID}
CENTURIA: ${env:CENTURIA, file(./secrets/secrets.json):CENTURIA}
custom:
bucket: ${env:BUCKET, file(./secrets/secrets.json):BUCKET}
s3:
port: 8000
directory: /tmp
plugins:
- serverless-s3-local
- serverless-offline
functions:
timetableApi:
handler: lib/handler.timetableFormatter
events:
- schedule: cron(0 0 * * ? *)
mensaApi:
handler: lib/handler.mensaFormatter
events:
- schedule: cron(0 0 * * ? *)
bot:
handler: lib/handler.bot
events:
- http:
path: bot
method: ANY
cors: true
resources:
Resources:
S3CalendarBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: ${self:custom.bucket}
WebsiteConfiguration:
IndexDocument: index.html