I am trying to understand the deployment size limits for AWS Lambda as I encountered the following error after adding another layer to my Lambda function:
An error occurred: <function name> - Function code combined with layers exceeds the maximum allowed size of 262144000 bytes. The actual size is 269081659 bytes. (Service: AWSLambdaInternal; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: <request ID>; Proxy: null).
I understand that the total uncompressed size of code + layers cannot exceed 250 MiB but I cannot understand how my code and layers have breached that limit. I especially cannot make my layers add up to the 'actual size' stated in the error.
I am using the Java 8 runtime and my jar is 54 MiB. Unzipped it is 140 MiB. I had two existing layers with the following sizes:
Layer |
Compressed size |
Uncompressed size |
Elasticsearch (jar) |
22 MiB |
54 MiB |
ImageMagick |
17 MiB |
58 MiB |
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…