forked from spectrocloud-labs/Slack-QA-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
71 lines (68 loc) · 2.01 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
frameworkVersion: '3'
service: slack-chat-gpt-bot
provider:
name: aws
runtime: python3.9
region: us-east-1
iam:
role:
statements:
- Effect: Allow
Action:
- lambda:InvokeFunction
- lambda:InvokeAsync
Resource: "*"
- Effect: Allow
Action:
- 's3:ListBucket'
- 's3:GetObject'
- 's3:GetObjectAcl'
- 's3:PutObject'
- 's3:PutObjectAcl'
- 's3:ReplicateObject'
- 's3:DeleteObject'
Resource:
- arn:aws:s3:::${env:SLACK_INSTALLATION_S3_BUCKET_NAME}
- arn:aws:s3:::${env:SLACK_INSTALLATION_S3_BUCKET_NAME}/*
- arn:aws:s3:::${env:SLACK_STATE_S3_BUCKET_NAME}
- arn:aws:s3:::${env:SLACK_STATE_S3_BUCKET_NAME}/*
- arn:aws:s3:::${env:OPENAI_S3_BUCKET_NAME}
- arn:aws:s3:::${env:OPENAI_S3_BUCKET_NAME}/*
environment:
SERVERLESS_STAGE: ${opt:stage, 'prod'}
SLACK_SIGNING_SECRET: ${env:SLACK_SIGNING_SECRET}
SLACK_CLIENT_ID: ${env:SLACK_CLIENT_ID}
SLACK_CLIENT_SECRET: ${env:SLACK_CLIENT_SECRET}
SLACK_SCOPES: ${env:SLACK_SCOPES}
SLACK_INSTALLATION_S3_BUCKET_NAME: ${env:SLACK_INSTALLATION_S3_BUCKET_NAME}
SLACK_STATE_S3_BUCKET_NAME: ${env:SLACK_STATE_S3_BUCKET_NAME}
OPENAI_S3_BUCKET_NAME: ${env:OPENAI_S3_BUCKET_NAME}
OPENAI_TIMEOUT_SECONDS: 25
SLACK_APP_LOG_LEVEL: WARN
TRANSLATE_MARKDOWN: true
functions:
app:
handler: main_prod.handler
timeout: 29
events:
- httpApi:
path: /slack/events
method: post
- httpApi:
path: /slack/install
method: get
- httpApi:
path: /slack/oauth_redirect
method: get
package:
patterns:
- "!.venv/**"
- "!node_modules/**"
- "!.idea/**"
plugins:
- serverless-python-requirements
custom:
pythonRequirements:
zip: true
slim: true
dockerizePip: true # This option must be enabled for including Linux compatible *.so files