This provides everything needed to package an aws lambda function and some trivial python (with some marginally less trivial packages) to show off end-to-end nix lambda packaging.
- Nix
- direnv (be certain to include the direnv hook for your shell)
- nix-direnv
- docker (for running the image locally)
- Clone the repository
- run the following in the repo base directory to give direnv permission:
direnv allow
- to package the python library, run the following:
nix-build
- to package the docker container, run the following on a compatible target platform (linux x86_64 gnu)
nix-build docker.nix
The target lambda container will be at result
.
- The target lambda can be pushed to the container service of choice and run within an aws lambda.
- To run locally, follow the instructions at aws docs to run the container via the lambda runtime emulator