-
Notifications
You must be signed in to change notification settings - Fork 5
/
template_no_auth.yaml
43 lines (42 loc) · 1.22 KB
/
template_no_auth.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
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Globals:
Function:
Timeout: 50
MemorySize: 5000
Api:
OpenApiVersion: 3.0.1
Parameters:
Stage:
Type: String
Default: dev
Resources:
# More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
LambdaAPI:
Type: AWS::Serverless::Api
Properties:
StageName: !Ref Stage
# More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
PredictFunction:
Type: AWS::Serverless::Function
Properties:
PackageType: Image
Architectures:
- x86_64
Events:
Predict:
Type: Api
Properties:
RestApiId: !Ref LambdaAPI
Path: /predict
Method: POST
Policies:
- AmazonS3FullAccess
Metadata:
Dockerfile: Dockerfile
DockerContext: ./
DockerTag: python3.9-v1
Outputs:
LambdaApi:
Description: "API Gateway endpoint URL for Dev stage for Predict Lambda function"
Value: !Sub "https://${LambdaAPI}.execute-api.${AWS::Region}.amazonaws.com/${Stage}/predict"