This repo is a template for deploying a python lambda function on AWS. Great if all you need is simple authentication, dependancies, and JSON responses.
- The AWS CLI installed on your local development machine
- Python 3.9
- Docker
- Terraform
- In this repo I use us-east-1. Change where necessary.
- Copy over the sample env file to
.env
and fill in the relevant fields. - Add packages with pipenv and code
- Clone this repo to store your own build images for python. Make sure your docker cli is logged in with your aws credentials. Create a private repository in AWS ECR if you haven't already named
[insert aws account id here].dkr.ecr.us-east-1.amazonaws.com/aws-sam-cli-build-image-python3.9
. Then use the commandmake build_python39
. - Deploy using
make deploy
- Pass authentication to the API endpoint within the "Authentication" HTTP header as raw, non-encoded text