From 483f7e14d8e3ddd143dc997e8df6a9616c69cc75 Mon Sep 17 00:00:00 2001 From: Simon Coe Date: Mon, 2 Oct 2023 15:25:15 +0000 Subject: [PATCH] default runtime to nodejs16.x Whilst the app runs on nodejs18.x, the AWS SKD supplied is version 3.x and this app references version 2.x. A lambda layer can be supplied for this to work. nodejs16.x comes bundled with v2.x of the AWS SDK, so no futher intervention is required. --- README.md | 2 +- infra/terraform/modules/_lambda/main.tf | 2 +- template.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 56f2ab0..7577be0 100755 --- a/README.md +++ b/README.md @@ -163,7 +163,7 @@ Detailed instructions on testing your function can be found [in the Wiki](https: ## Build Requirements * [npm](https://www.npmjs.com/) ^7.20.0 -* [node](https://nodejs.org/en/) ^18.0 +* [node](https://nodejs.org/en/) ^16.0 * [openssl](https://www.openssl.org) ## Building Generic Packages diff --git a/infra/terraform/modules/_lambda/main.tf b/infra/terraform/modules/_lambda/main.tf index 2afa1bb..a609e85 100644 --- a/infra/terraform/modules/_lambda/main.tf +++ b/infra/terraform/modules/_lambda/main.tf @@ -20,7 +20,7 @@ resource "aws_lambda_function" "main" { role = aws_iam_role.lambda.arn handler = "index.handler" source_code_hash = base64sha256(var.package_url) - runtime = "nodejs18.x" + runtime = "nodejs16.x" timeout = var.timeout publish = var.lambda_at_edge tags = var.tags diff --git a/template.yaml b/template.yaml index c500e25..543b232 100644 --- a/template.yaml +++ b/template.yaml @@ -8,7 +8,7 @@ Resources: Properties: CodeUri: distributions/{distribution_name}/{distribution_name}.zip Role: !GetAtt LambdaEdgeFunctionRole.Arn - Runtime: nodejs18.x + Runtime: nodejs16.x Handler: index.handler Timeout: 5 AutoPublishAlias: LIVE