-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathserverless.yml
More file actions
106 lines (100 loc) · 2.89 KB
/
serverless.yml
File metadata and controls
106 lines (100 loc) · 2.89 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# org: nalbam
app: lambda-gureumi-ai-bot
service: lambda-gurumi-ai-bot
provider:
name: aws
region: us-east-1
runtime: python3.12
stage: ${opt:stage, 'dev'}
memorySize: 5120
timeout: 90
environment:
BASE_NAME: gurumi-ai-bot
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:Query
- dynamodb:Scan
- dynamodb:DeleteItem
Resource:
- "arn:aws:dynamodb:${self:provider.region}:*:table/${self:provider.environment.BASE_NAME}-*"
- "arn:aws:dynamodb:${self:provider.region}:*:table/${self:provider.environment.BASE_NAME}-*/index/*"
- Effect: Allow
Action:
- bedrock:InvokeAgent
Resource:
- "arn:aws:bedrock:${self:provider.region}:*:agent-alias/*"
- Effect: Allow
Action:
- bedrock:Retrieve
Resource:
- "arn:aws:bedrock:${self:provider.region}:*:knowledge-base/*"
- Effect: Allow
Action:
- bedrock:InvokeModel
Resource:
- "arn:aws:bedrock:${self:provider.region}::foundation-model/anthropic.claude-*"
- "arn:aws:bedrock:${self:provider.region}::foundation-model/stability.stable-*"
functions:
mention:
handler: handler.lambda_handler
events:
- http:
method: post
path: /slack/events
kakao:
handler: handler.kakao_handler
events:
- http:
method: post
path: /kakao/events
resources:
Resources:
DynamoDBTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: ${self:provider.environment.BASE_NAME}-${self:provider.stage}
AttributeDefinitions:
- AttributeName: id
AttributeType: S
- AttributeName: user
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
GlobalSecondaryIndexes:
- IndexName: user-index
KeySchema:
- AttributeName: user
KeyType: HASH
Projection:
ProjectionType: KEYS_ONLY
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
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