-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.yaml
50 lines (44 loc) · 1.95 KB
/
template.yaml
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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
langchain-aws-telebot
Telegram Bot for tutoring
Globals: # https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-specification-template-anatomy-globals.html
Function:
Timeout: 5
MemorySize: 256
Runtime: python3.11
Resources:
LangchainBotFunction:
Type: AWS::Serverless::Function # More info about Function Resource: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html
Properties:
Handler: app.lambda_handler
CodeUri: langchain_bot/
Description: Chat with Bot function
Policies:
- AWSLambdaBasicExecutionRole
- AmazonDynamoDBFullAccess
Architectures:
- x86_64
Tracing: Active
Events:
HelloPath:
Type: Api # More info about API Event Source: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-property-function-api.html
Properties:
Path: /
Method: POST
# Powertools env vars: https://awslabs.github.io/aws-lambda-powertools-python/#environment-variables
Environment:
Variables:
POWERTOOLS_SERVICE_NAME: PowertoolsLangchainBot
POWERTOOLS_METRICS_NAMESPACE: Powertools
LOG_LEVEL: INFO
Tags:
LambdaPowertools: python
Outputs:
LangchainBotApi:
Description: "API Gateway endpoint URL for Prod environment for Langchain Bot Function"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/"
LangchainBotFunction:
Description: "Langchain Bot Lambda Function ARN"
Value: !GetAtt LangchainBotFunction.Arn