I have an AWS Lambda function that only has 3 files in the working directory. Two of these files are Linux binaries that I need to execute (via spawnSync) whenever the function.
The issue is that one of these binaries is almost 80MB in size, making the package size far too big. This means that I cannot edit the code or file structure or deploy and test via the Lambda inline editor.
As I’m extremely new to the AWS environment, this makes it very difficult to learn and debug.
So, how should I go about editing the codebase of my Lambda functions when they exceed 25MB? Is this something that I should be handling via GitHub? Should I be storing my massive binaries somewhere else and calling them from there?
2
Answers
You won’t be able to use the inline editor on AWS Console due to size limits. You need to do the edits wherever your code is written.
As mentioned in lambda quotas. You won’t be able to see/edit the code if it’s over 3MB.
There are plenty of options to deal with this.
In simple words, you can reduce your package size by uploading your binary as a layer and accessing it inside the lambda. I wrote a blog on this for better understanding. https://dev.classmethod.jp/articles/simplify-your-lambda-dependencies-with-lambda-layers/
Reducing your lambda deployment package size is listed best practice.. These are little advanced ways: