forked from iwpnd/fastapi-aws-lambda-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.yml
More file actions
32 lines (31 loc) · 1.27 KB
/
template.yml
File metadata and controls
32 lines (31 loc) · 1.27 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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
fastAPI aws lambda example
Resources:
FastapiExampleLambda:
Type: AWS::Serverless::Function
Properties:
Events:
ApiEvent:
Properties:
RestApiId:
Ref: FastapiExampleGateway
Path: /{proxy+}
Method: ANY
Type: Api
FunctionName: fastapi-lambda-example
CodeUri: ./
Handler: example_app.main.handler
Runtime: python3.7
Timeout: 300 # timeout of your lambda function
MemorySize: 128 # memory size of your lambda function
Description: fastAPI aws lambda example
# other options, see ->
# https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-specification-template-anatomy-globals.html#sam-specification-template-anatomy-globals-supported-resources-and-properties
Role: !Sub arn:aws:iam::${AWS::AccountId}:role/fastapilambdarole
FastapiExampleGateway:
Type: AWS::Serverless::Api
Properties:
StageName: prod
OpenApiVersion: '3.0.0'