[aws-lambda] Lambda zip from DockerFile #9329
Labels
@aws-cdk/aws-lambda
Related to AWS Lambda
effort/large
Large work item – several weeks of effort
feature-request
A feature should be added or improved.
in-progress
This issue is being actively worked on.
p2
Currently CDK supports many ways to generate Lambda assets:
However, I think there is one obvious way that is missing: generating the Lambda zip by building a DockerFile. The code should simply build a Dockerfile, and then extract the
/var/task
directory from the built image and zip it for Lambda.This would allow all the features of a Dockerfile to be used in a really simple manner - such as multi-stage builds, caching, etc.
Use Case
Building Lambda functions that utilize native code requires using Docker images to get the right libraries. It is hard to build a custom bundler for each usage when the desire is to simply be able to customize the build process inside the docker.
Proposed Solution
The calling code could be:
Should have support for common Docker build things like build arguments, specifying the Dockerfile separately from the root directory, etc.
Simple example for Nodejs:
Simple example for Python:
More complex example for Rust:
Other
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: