From today, AWS Lambda supports NodeJS 8.10.
You can migrate to the NodeJS 8.10 with this migration guide.
tl;dr: just change
runtime: nodejs6.10 to
runtime: nodejs8.10 at the
IDK why but for some reason, AWS Lambda@Edge doesn’t support NodeJS 8.10.
So, If you set Lambda@Edge function in the same
serverless.yml file, that will make an error like below.
An error occurred: CloudFrontDistribution - The function has an invalid runtime for functions that are triggered by a CloudFront event: nodejs8.10 Expecting: nodejs6.10 Function: arn:aws:lambda:us-east-1:966390130392:function:~~~~:13 (Service: AmazonCloudFront; Status Code: 400; Error Code: InvalidLambdaFunctionAssociation; Request ID: 0d529603-37e3-11e8-bcb4-3d379f0b0c9a).
You can avoid that error by overriding the runtime property like above image.
If you write
runtime: nodejs6.10 inside of the each function, it overrides the global setting.
So, just override it inside of the Lambda@Edge function setting.