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.

gefragt vor einem Jahr11850 Aufrufe
1 Antwort
1
Akzeptierte Antwort

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
EXPERTE
beantwortet vor einem Jahr
profile pictureAWS
EXPERTE
überprüft vor einem Jahr

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen