-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
77 lines (77 loc) · 1.9 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
service: "dalle"
plugins:
- serverless-esbuild
- serverless-offline
- serverless-iam-roles-per-function
package:
individually: true
patterns:
- "!node_modules/.prisma/client/libquery_engine-*"
- "node_modules/.prisma/client/libquery_engine-linux-arm64-*"
- "!node_modules/prisma/libquery_engine-*"
- "!node_modules/@prisma/engines/**"
custom:
esbuild:
plugins: esbuild-plugins.js
offline:
useChildProcesses: true
provider:
name: aws
runtime: nodejs18.x
region: us-east-2
vpc:
subnetIds:
# Managed by Terraform
- subnet-xyz
securityGroupIds:
# Managed by Terraform
- sg-xyz
logs:
restApi: true
resources:
Resources:
ImageRequestQueue:
Type: "AWS::SQS::Queue"
Properties:
QueueName: ${opt:stage, 'local'}-dalle-image-request.fifo
DeduplicationScope: "messageGroup"
FifoQueue: true
FifoThroughputLimit: "perMessageGroupId"
VisibilityTimeout: 60
functions:
dalle:
handler: handlers/dalle/src/index.handler
timeout: 20
iamRoleStatements:
- Effect: "Allow"
Action:
- sqs:ChangeMessageVisibility
- sqs:DeleteMessage
- sqs:GetQueueAttributes
- sqs:ReceiveMessage
Resource: !GetAtt ImageRequestQueue.Arn
events:
- sqs:
arn:
Fn::GetAtt:
- ImageRequestQueue
- Arn
slack:
handler: handlers/slack/src/index.handler
environment: ${file(./env.${opt:stage, 'local'}.yml):slack-environment}
iamRoleStatements:
- Effect: "Allow"
Action:
- sqs:GetQueueAttributes
- sqs:SendMessage
Resource: !GetAtt ImageRequestQueue.Arn
events:
- http:
path: /slack/install
method: get
- http:
path: /slack/oauth_redirect
method: get
- http:
path: /slack/events
method: post