-
Notifications
You must be signed in to change notification settings - Fork 9
/
template.yml
32 lines (31 loc) · 1.31 KB
/
template.yml
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: FastapiPostgresBoilerplate
Path: /{proxy+}
Method: ANY
Type: Api
FunctionName: fastapi-postgres-boilerplate
CodeUri: ./
Handler: server.main.handler
Runtime: python3.8
Timeout: 300 # timeout of your lambda function
MemorySize: 128 # memory size of your lambda function
Description: fastAPI boilerplate with postgres support
# 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/fastapi-postgres-boilerplate
FastapiPostgresBoilerplate:
Type: AWS::Serverless::Api
Properties:
StageName: prod
OpenApiVersion: '3.0.1'