-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
53 lines (50 loc) · 1.18 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
frameworkVersion: "3"
service: tmykbot-slack
provider:
name: aws
# See also https://docs.aws.amazon.com/lambda/latest/dg/lambda-python.html
runtime: python3.11
region: us-east-1
iam:
role:
statements:
# For Lazy Listeners
- Effect: Allow
Action:
- lambda:InvokeFunction
- lambda:InvokeAsync
Resource: "*"
- Effect: Allow
Action:
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:Scan
- dynamodb:Query
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource: "arn:aws:dynamodb:us-east-1:*:table/*"
environment:
SERVERLESS_STAGE: ${opt:stage, 'prod'}
SLACK_BOT_TOKEN: ${env:SLACK_BOT_TOKEN}
SLACK_SIGNING_SECRET: ${env:SLACK_SIGNING_SECRET}
functions:
app:
handler: main.lambda_handler
# url: true
events:
- httpApi:
path: /slack/events
method: post
package:
patterns:
- "!env/**"
- "!node_modules/**"
- "!.idea/**"
- "!local-test.sh"
- "!package*.json"
plugins:
- serverless-python-requirements
custom:
pythonRequirements:
zip: true
slim: true