-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate-prod.yaml
More file actions
74 lines (68 loc) · 1.97 KB
/
Copy pathtemplate-prod.yaml
File metadata and controls
74 lines (68 loc) · 1.97 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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: UML Diagram Generator API (Production - AWS Deployment)
Globals:
Function:
Timeout: 300 # 3 minutos para Lambda
MemorySize: 1024
Runtime: python3.12
Environment:
Variables:
GOOGLE_API_KEY: !Ref GoogleApiKey
GEMINI_MODEL_NAME: !Ref GeminiModelName
Parameters:
GoogleApiKey:
Type: String
Description: Google Gemini API Key
NoEcho: true
Default: "dummyApikey"
GeminiModelName:
Type: String
Description: Gemini model name
Default: "gemini-2.5-flash"
Resources:
# Lambda Layer for dependencies
DependenciesLayer:
Type: AWS::Serverless::LayerVersion
Properties:
LayerName: uml-generator-dependencies
Description: Dependencies for UML Generator
ContentUri: layers/dependencies/
CompatibleRuntimes:
- python3.12
RetentionPolicy: Delete
Metadata:
BuildMethod: python3.12
# Main Lambda Function with Function URL
UMLGeneratorFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: uml-diagram-generator
CodeUri: backend/
Handler: src.handlers.main_handler.lambda_handler
Layers:
- !Ref DependenciesLayer
FunctionUrlConfig:
AuthType: NONE
#Cors: #ya lo tiene el codigo python
# AllowCredentials: false
# AllowHeaders:
# - "Content-Type"
# - "X-Amz-Date"
# - "Authorization"
# AllowMethods:
# - "POST"
# AllowOrigins:
# - "*"
# MaxAge: 86400
Environment:
Variables:
PYTHONPATH: /opt/python:/var/runtime:/var/task
GOOGLE_API_KEY: !Ref GoogleApiKey
GEMINI_MODEL_NAME: !Ref GeminiModelName
Outputs:
UMLGeneratorFunctionArn:
Description: "UML Generator Lambda Function ARN"
Value: !GetAtt UMLGeneratorFunction.Arn
Export:
Name: UMLGeneratorFunctionArn