- Newest
- Most votes
- Most comments
The 111.9 MB in the screenshot is the size of the compressed zip file. As per the error message and also stated in the quota documentation (https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html#function-configuration-deployment-and-execution), the total size of the deployment package must not exceed 250 MB after being uncompressed ("unzipped"), or in other words, in the form it would take in the local file system of the Lambda function's runtime environment.
I suggest you unpack the zip file on your local system and check the total size of the files it contains.
The issue you're facing is related to the size limit for Lambda deployment packages. While AWS Lambda allows deployment packages up to 250 MB when uploaded through AWS CLI or SDKs, there's a smaller limit of 50 MB when uploading directly through the AWS Management Console.
In your case, even though your zip file in S3 is 111.9 MB, which is below the 250 MB limit, it's still above the 50 MB limit for direct uploads through the console. This explains the "RequestEntityTooLargeException" error you're seeing.
To resolve this issue, you have a few options:
-
Use the AWS CLI or SDK to deploy your Lambda function instead of the console. This will allow you to use the full 250 MB limit.
-
Optimize your deployment package to reduce its size. This could involve removing unnecessary dependencies or files.
-
Consider using Lambda Layers to separate some of your dependencies from your main function code. This can help reduce the size of your main deployment package.
-
If your package size cannot be reduced below 250 MB, you should consider using container images for your Lambda function. Lambda supports container images up to 10 GB in size, which would easily accommodate your current package.
Remember, when using S3 to store your deployment package, make sure the S3 bucket is in the same region as your Lambda function to avoid any potential issues.
If you continue to face issues or if your package size grows beyond these limits, you might want to explore using container images for your Lambda function, which allows for much larger deployments up to 10 GB.
Sources
Troubleshoot deployment issues in Lambda - AWS Lambda
Not able to use deepeval on Lambda | AWS re:Post
Lambda Package Exceeds 60MB: Solutions for Large Dependencies? | AWS re:Post
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated 3 years ago
