3 Ways to Overcome AWS Lambda Deployment Size Limit — Part 2
In the previous article, I shared 2 approaches on how to overcome the AWS Lambda deployment size limit, i.e. using S3 or AWS EFS to store large data files/dependencies. In this article, I will share how we can use Lambda with container image to achieve the same.
A bit of context, AWS announced at the end of 2020 that AWS Lambda will now provide container image support. With that, a user can now deploy Lambda functions up to 10GB in size, vastly increased from the existing 250MB limit. AWS provides base images that we can use for all the supported Lambda runtimes (Python, Nodejs, etc.). Otherwise, you can create a custom image by implementing the Lambda Runtime API.
Implementation
The implementation for my example is fairly straightforward. In the case of using container image, we don’t need to make any modification to the original handler function and we don’t need to move the data file away from our repository. My final directory structure looks something like below:
Steps: