-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.yaml
More file actions
80 lines (74 loc) · 1.99 KB
/
Copy pathtemplate.yaml
File metadata and controls
80 lines (74 loc) · 1.99 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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: BeanRatio - Coffee Ratio Optimizer
Globals:
Function:
Timeout: 30
MemorySize: 256
Runtime: python3.13
Environment:
Variables:
S3_BUCKET_NAME: beanratio-data
AUTH_TOKEN: test-token-12345
Resources:
# Lambda Layer for dependencies
BeanRatioDependenciesLayer:
Type: AWS::Serverless::LayerVersion
Properties:
LayerName: beanratio-dependencies
ContentUri: lambda/layer/
CompatibleRuntimes:
- python3.13
# Lambda Function with Function URL
BeanRatioApiFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: beanratio-api
CodeUri: lambda/
Handler: functions.api_handler.lambda_handler
Layers:
- !Ref BeanRatioDependenciesLayer
Architectures:
- x86_64
Events:
ApiEvent:
Type: HttpApi
Properties:
Path: /{proxy+}
Method: ANY
Environment:
Variables:
S3_BUCKET_NAME: beanratio-data
AUTH_TOKEN: test-token-12345
# Lambda Function URL Configuration
BeanRatioFunctionUrl:
Type: AWS::Lambda::Url
Properties:
TargetFunctionArn: !GetAtt BeanRatioApiFunction.Arn
AuthType: NONE
Cors:
AllowOrigins:
- '*'
AllowMethods:
- GET
- POST
- PUT
- DELETE
- OPTIONS
AllowHeaders:
- Content-Type
# Permission for Function URL
BeanRatioFunctionUrlPermission:
Type: AWS::Lambda::Permission
Properties:
FunctionName: !GetAtt BeanRatioApiFunction.Arn
FunctionUrlAuthType: NONE
Action: lambda:InvokeFunctionUrl
Principal: '*'
Outputs:
BeanRatioApiFunction:
Description: BeanRatio API Function ARN
Value: !GetAtt BeanRatioApiFunction.Arn
BeanRatioApiFunctionUrl:
Description: BeanRatio API Function URL
Value: !GetAtt BeanRatioFunctionUrl.FunctionUrl