Skip to content

Ricardo-VP/serverless-fastapi

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Serverless + FastAPI (Mangum) + Terraform

How to try this? πŸ€”

Generate the lambda zip file (Unix/macOS) πŸ—

  1. Init venv: "python3 -m virtualenv -p python3.8 env"
  2. Activate venv: "source ./env/bin/activate"
  3. Install dependencies: "python3 -m pip install -r requirements.txt"
  4. Create zip file with the venv packages: "cd env/lib/python3.8/site-packages && zip -r9 ../../../../lambda.zip ."
  5. Add app files to the zip: "cd ../../../../ && zip -g lambda.zip -r app"

Lets deploy this πŸš€

  1. terraform init
  2. terraform plan # if all it's okay then go to the next step
  3. terraform apply

About

Repo for https://www.deadbear.io/simple-serverless-fastapi-with-aws-lambda/ but this repo also includes terraform πŸš€

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HCL 78.2%
  • Python 21.8%