By using AWS re:Post, you agree to the AWS re:Post Terms of Use

Error while deploying the HTTP API + Lambda using AWS SAM

0

I will tell you the whole story and how I got to the error so you will have more insight into my error so your answer might be more indicative of my overall issue. So I created Prod env manually, and everything is working fine. My system includes Lambda + APIGateway + WordPress and everything works. Now I'm trying to build a better environment with smooth deployment that will be easy to control, so I and started working with AWS SAM. My first step was to create the REST API with AWS SAM which caused me a lot of issues, and after research, I understood my approach with REST API was wrong and HTTP API is more right for me. I did so and converted my Lambda to parse the endpoints(which atm happens wrong) but my main issue right now is that I get a new error that doesn't let me deploy the lambda and the HTTP API. My deployment happens from the root folder of the project - I go to the lambda folder (landwisely-lambda): I run the commands yarn build and sam build I go to the root folder(lw-http-api): I run the sam package and sam deploy.

  • If it is possible I would like to get an example of how the event from the HTTP API is sending the event since my parsing is wrong it fails immediately on the parse.

I'm in a rush since this improvement will help the start-up have faster shipping velocity. Thank you in advance! SAM Error File Structure

1 Answer
1

The error message in the screenshot says that your Lambda function's deployment package is larger (after being decompressed) than the maximum allowed size of 250 MiB. Is that the error you're working on, or did you get the Lambda function deployed already and are working on some other error?

EXPERT
answered 5 months ago
profile picture
EXPERT
reviewed 5 months ago
profile pictureAWS
EXPERT
reviewed 5 months ago
  • I work on the same error. I used to be able to deploy it once and after I wanted to redeploy it the error just started to appear. There is no way my Lambda is more than 250MiB since I don't have much code at all.

  • All we can see in the error message is that Lambda is of the mind that there's more than 250 MiB in the package when unzipped. Perhaps you could just unzip the Lambda zip on your local system and check its total size with du?

  • I'm using the SAM so how can I know what it wraps in the zip?

  • If you look at the template of the CloudFormation stack that failed to deploy in the CloudFormation console, you should find the Lambda function declaration there, along with a link to the zip deployment package stored in S3. You can download it from S3.

  • Understood, I will do the checking soon as possible and will come back with an answer.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions