3
creating Lambda lambda.setupRequestListeners
      { RequestEntityTooLargeException: Request must be smaller than 69905067 bytes for the CreateFunction operation
    message: 'Request must be smaller than 69905067 bytes for the CreateFunction operation',
      code: 'RequestEntityTooLargeException',
      time: 2017-06-22T08:30:52.260Z,
      requestId: 'xxx',
      statusCode: 413,
      retryable: false,
      retryDelay: 89.31111557639109 
      }

Is my project too big or what is happening here? Can I upload it through S3 or does it have to do with the number of routes in my project?

The same deploy technique works with a smaller project that has only a couple of routes.

I am using claudia.js with these commands:

"scripts": {
    "deploy": "claudia create --handler lambda.handler --name authService --deploy-proxy-api --region eu-central-1",
    "update": "claudia update",
    "generate-proxy": "claudia generate-serverless-express-proxy --express-module server",
    "test": "./node_modules/.bin/mocha --reporter spec"
  },
Community
  • 1
  • 1
Simon Guldstrand
  • 488
  • 1
  • 5
  • 24

2 Answers2

2

Two approaches that you can follow to test this : 1) AWS CLI Deploying function code from S3 allows for substantially larger deployment packages when compared to directly uploading to Lambda.

There are two ways to get your Lambda function’s code into AWS Lambda: either directly uploading the function’s deployment package, or having Lambda pull it from S3.

https://hackernoon.com/exploring-the-aws-lambda-deployment-limits-9a8384b0bec3

2) ClaudiaJS CLI

Read here: https://claudiajs.com/news/2016/09/21/claudia-1.9.0.html

claudia create --handler lambda.handler --deploy-proxy-api --region us-south-1 --use-s3-bucket bucket-name

thank you @Gojko for your contribution.

Sikandar Khan
  • 129
  • 2
  • 16
1

there are two good ways to solve this. one is to use an intermediary S3 bucket to deploy your code. Claudia can upload the zip file to S3, then make a smaller request to Lambda to just take the code from S3. use --use-s3-bucket <bucket name> with claudia update for that.

the second option is to put stuff you don't need immediately somewhere (eg s3) and download to the /tmp directory when the lambda starts up. we use this for large font files or third party binaries.

Gojko Adzic
  • 1,241
  • 10
  • 9