-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yaml
44 lines (41 loc) · 1.36 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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Globals:
Function:
Timeout: 10
MemorySize: 5000
Api:
BinaryMediaTypes:
- image/png
- image/jpg
- image/jpeg
Resources:
InferenceFunction:
Type: AWS::Serverless::Function # More info about Function Resource: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html
Properties:
PackageType: Image
Events:
InferenceApi:
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: /predict
Method: post
Architectures:
- x86_64
Environment:
Variables:
FASTAPI_MODULE: "lambda_function.lambda_handler"
ImageUri: inferencefunction:python3.11-v1
Policies:
- AWSLambdaBasicExecutionRole # Ensure the Lambda has basic execution permissions
Metadata:
Dockerfile: Dockerfile
DockerContext: .
DockerTag: python3.11-v1
Outputs:
InferenceFunction:
Description: Inference Lambda Function ARN
Value: !GetAtt InferenceFunction.Arn
InferenceFunctionIamRole:
Description: Implicit IAM Role created for Inference function
Value: !GetAtt InferenceFunctionRole.Arn