Lambda: Failed to create layer version: Unzipped size must be smaller than 262144000 bytes

0

Please i need help creating a layer.

I have previously done this, only this time my zip file that contains all dependencies is about 600+ mb, and Lambda has a limit of 250mb.

What other options do i have, i am thinking docker but i don't know my way around that. But if there are other options i would love to hear thank you.

The project is running completely using python.

preguntada hace un año11849 visualizaciones
1 Respuesta
1
Respuesta aceptada

I'd check that all the dependencies included in the zip file are required and if not exclude what can be removed. Like you can remove node_modules in NodeJs or venv in Python.

The alternative solutions depend on the use case, for instance how often is your Lambda invoked? if it's invoked once per day or such, you can eventually load the dependencies from S3 on start. You can also mount an EFS network share to your lambda [2]

A container image is a good solution for this and you can create an image up to 10Gb. The documentation describes the steps to follow to get started [2].

[1] https://aws.amazon.com/blogs/compute/using-amazon-efs-for-aws-lambda-in-your-serverless-applications/ [2] https://docs.aws.amazon.com/lambda/latest/dg/images-create.html

profile pictureAWS
EXPERTO
respondido hace un año
profile pictureAWS
EXPERTO
revisado hace un año

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas