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.

1개 답변
1
수락된 답변

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
전문가
답변함 일 년 전
profile pictureAWS
전문가
검토됨 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠