We are using Vapor to deploy our Laravel App to AWS Lambda.
After small change (10 lines were introduced), the deploy process via GitHub action fails with the following message:
Message: Your application exceeds the maximum size allowed by AWS Lambda.
Now we can not deploy to this env (develop). All other branches (staging, production) are fine and we can use them.
No new libraries or any big changes were introduced between the last deploy.
Deploy via Vapor CLI also fails with the same message.
Any ideas where we can search for the source of the problem?
Lambda deployment packages have a size limit of 50 MB. The deployment package of your dev branch is crossing that limit. That's why you get the error Your application exceeds the maximum size allowed by AWS Lambda.
If reducing the size of your deployment package is not an option, upload the package to S3 & provide the S3 URL to the Lambda function. The deployment package is allowed to have a max size of 250 MB (uncompressed) when you go the S3 route.
See my blog post for more details!