-
Notifications
You must be signed in to change notification settings - Fork 2
/
serverless.yml
80 lines (75 loc) · 2.08 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
# org: nalbam
app: lambda-gureumi-ai-bot
service: lambda-gurumi-ai-bot
provider:
name: aws
region: us-east-1
runtime: python3.11
# stage: prod
# memorySize: 5120
timeout: 600
environment:
BASE_NAME: gurumi-ai-bot
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:*
Resource:
- "arn:aws:dynamodb:*:*:table/${self:provider.environment.BASE_NAME}-*"
- Effect: Allow
Action:
- bedrock:Retrieve
Resource:
# - "arn:aws:bedrock:*:*:knowledge-base/${self:provider.environment.BASE_NAME}-*"
- "arn:aws:bedrock:*:*:knowledge-base/*"
- Effect: Allow
Action:
- bedrock:InvokeModel
Resource:
- "arn:aws:bedrock:*::foundation-model/anthropic.claude-*"
- "arn:aws:bedrock:*::foundation-model/stability.stable-diffusion-*"
functions:
mention:
handler: handler.lambda_handler
events:
- http:
method: post
path: /slack/events
tags:
Project: ${self:provider.environment.BASE_NAME}
resources:
Resources:
DynamoDBTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: ${self:provider.environment.BASE_NAME}-context
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
TimeToLiveSpecification:
AttributeName: expire_at
Enabled: true
Tags:
- Key: Project
Value: ${self:provider.environment.BASE_NAME}
S3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName:
Fn::Sub: ${self:provider.environment.BASE_NAME}-${AWS::AccountId}
Tags:
- Key: Project
Value: ${self:provider.environment.BASE_NAME}
# KnowledgeBase:
# Type: AWS::Bedrock::KnowledgeBase
# Properties:
# Name: ${self:provider.environment.BASE_NAME}-knowledge-base
plugins:
- serverless-python-requirements
- serverless-dotenv-plugin