Skip to content
This repository was archived by the owner on Jan 28, 2025. It is now read-only.

Latest commit

 

History

History
70 lines (54 loc) · 1.63 KB

lambdaatedgeconfig.md

File metadata and controls

70 lines (54 loc) · 1.63 KB
id title sidebar_label
lambdaatedgeconfig
Lambda At Edge Configuration
Lambda At Edge Configuration

Both default and api edge lambdas will be assigned 512mb of memory by default. This value can be altered by assigning a number to the memory input

# serverless.yml

myNextApplication:
  component: serverless-next.js
  inputs:
    memory: 1024

Values for default and api lambdas can be separately defined by assigning memory to an object like so:

# serverless.yml

myNextApplication:
  component: serverless-next.js
  inputs:
    memory:
      defaultLambda: 1024
      apiLambda: 2048

The same pattern can be followed for specifying the Node.js runtime (nodejs12.x by default):

# serverless.yml

myNextApplication:
  component: serverless-next.js
  inputs:
    runtime:
      defaultLambda: "nodejs10.x"
      apiLambda: "nodejs10.x"

Similarly, the timeout by default is 10 seconds. To customise you can:

# serverless.yml

myNextApplication:
  component: serverless-next.js
  inputs:
    timeout:
      defaultLambda: 20
      apiLambda: 15

Note the maximum timeout allowed for Lambda@Edge is 30 seconds. See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-requirements-limits.html

You can also set a custom name for default and api lambdas - if not the default is set by the aws-lambda serverless component to the resource id:

# serverless.yml

myNextApplication:
  component: serverless-next.js
  inputs:
    name:
      defaultLambda: fooDefaultLambda
      apiLambda: fooApiLambda