Lambda Deployment package fails with size error

0

Maybe I am missing something obvious but I was wondering why the Code Pipeline is failing on the Code Deploy step even though my outputted artifacts is below the space requirement? My zipped package is 48 MB and my unzipped is 213 MB, both of which are under the 50 MB and 250 MB limits.

The error that I'm getting is:

Resource handler returned message: "Code uncompressed size is greater than max allowed size of 272629760. (Service: Lambda, Status Code: 400, Request ID: 42a0e0c4-031a-4481-9a6d-765a662123f5)" (RequestToken: 22cbb818-6658-7473-f6c7-65f1872593ca, HandlerErrorCode: InvalidRequest)```

I tried the following:
- used `npm shrinkwrap`, `npm ci`, and `npm install --production` as well as a combination of the three to get my space under the limit
- copied the package-lock.json of a previous successful pipeline and it still fails
- hardcoding the CodeUri of a previous successful pipeline and it failed

Is there something that I missed? I was thinking of doing the Lambda Layers next but im not sure what that will change since that is used for reducing the size when we are already under the limit.
1개 답변
0

Using Lambda Layers won't help in this case because all of your code (including the layers) must be under 250 MB uncompressed. The Lambda service is showing that combined size in the error message.

You might consider using a container image instead as they have larger size limits.

profile pictureAWS
전문가
답변함 일 년 전
AWS
전문가
검토됨 일 년 전
  • Ah appreciate it, I was looking into that too. Do you have an idea of why the size issue is still being triggered or what areas I should check? I did a "Get Info" on an unzipped package straight from the S3 bucket that I upload the artifact to in the pipeline and it was only 213 MB.

  • From this distance it's impossible to say why the Lambda service is giving that error. The best way to find out is to contact our support team.

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

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

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

관련 콘텐츠