Binary dependencies with AWS Lambda
11 Sep 2018When you’re developing an AWS Lambda, sometimes you’re going to need to install binary package dependencies. Today’s article will take you through the construction of a project that can be deployed into AWS Lambda including your binary dependencies.
Structure
The whole idea here is based on AWS Lambda using Docker to facilite package, deployment, and execution of your function. The standard python:3.6
image available in the standard library is compatible with what we’ll end up deploying.
The structure of your project should have a requirements.txt
file holding your dependencies, a standard Dockerfile
and of course, your code.
Any depeendencies are listed out by the requirements.txt
file.
Docker
We can now bundle our application up, so that it can be used by AWS Lambda.
The docker container is then built with the following:
The retrieves the zip
file that we built through the process, that’s readily deployable to AWS Lambda.