From d163378e91b4bf6759455dd457c13065d9aff919 Mon Sep 17 00:00:00 2001 From: Marc Mettke Date: Sun, 24 Dec 2023 14:19:47 +0100 Subject: [PATCH] Updating lambda functions to nodejs 20 --- .github/workflows/tests-integration.yml | 4 ++-- .github/workflows/tests.yml | 4 ++-- template.yml | 6 +++--- terraform/module/lambda.tf | 12 ++++++------ 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests-integration.yml b/.github/workflows/tests-integration.yml index 6d72a2f..0b02878 100644 --- a/.github/workflows/tests-integration.yml +++ b/.github/workflows/tests-integration.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [16.x] + node-version: [20.x] steps: - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} @@ -33,4 +33,4 @@ jobs: use-installer: true - run: sam build --use-container - - run: sam deploy --no-confirm-changeset --no-fail-on-empty-changeset --stack-name aws-lambda-power-tuning-gh-${GITHUB_REF_NAME/\//-} --s3-bucket ${{ secrets.AWS_S3_BUCKET }} --capabilities CAPABILITY_IAM --region ${{ secrets.AWS_REGION }} \ No newline at end of file + - run: sam deploy --no-confirm-changeset --no-fail-on-empty-changeset --stack-name aws-lambda-power-tuning-gh-${GITHUB_REF_NAME/\//-} --s3-bucket ${{ secrets.AWS_S3_BUCKET }} --capabilities CAPABILITY_IAM --region ${{ secrets.AWS_REGION }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 78ba99a..69c7511 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [15.x, 16.x, 17.x, 18.x, 19.x] + node-version: [15.x, 16.x, 17.x, 18.x, 19.x, 20.x] steps: - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} @@ -24,4 +24,4 @@ jobs: - name: Coveralls uses: coverallsapp/github-action@v1 with: - github-token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/template.yml b/template.yml index aa6a339..cce0e81 100644 --- a/template.yml +++ b/template.yml @@ -73,7 +73,7 @@ Conditions: Globals: Function: - Runtime: nodejs16.x + Runtime: nodejs20.x MemorySize: 128 Timeout: !Ref totalExecutionTimeout PermissionsBoundary: !If [UsePermissionsBoundary, !Ref permissionsBoundary, !Ref AWS::NoValue] @@ -98,11 +98,11 @@ Resources: Description: AWS SDK 2.1134.0 ContentUri: ./layer-sdk CompatibleRuntimes: - - nodejs16.x + - nodejs20.x LicenseInfo: 'Available under the MIT-0 license.' RetentionPolicy: Retain Metadata: - BuildMethod: nodejs16.x + BuildMethod: nodejs20.x initializerLogGroup: Type: AWS::Logs::LogGroup diff --git a/terraform/module/lambda.tf b/terraform/module/lambda.tf index f8f91bd..40d9c4f 100644 --- a/terraform/module/lambda.tf +++ b/terraform/module/lambda.tf @@ -13,7 +13,7 @@ resource "aws_lambda_function" "analyzer" { # source_code_hash = "${base64sha256(file("lambda_function_payload.zip"))}" source_code_hash = data.archive_file.app.output_base64sha256 - runtime = "nodejs16.x" + runtime = "nodejs20.x" dynamic "vpc_config" { for_each = var.vpc_subnet_ids != null && var.vpc_security_group_ids != null ? [true] : [] @@ -50,7 +50,7 @@ resource "aws_lambda_function" "cleaner" { # source_code_hash = "${base64sha256(file("lambda_function_payload.zip"))}" source_code_hash = data.archive_file.app.output_base64sha256 - runtime = "nodejs16.x" + runtime = "nodejs20.x" dynamic "vpc_config" { for_each = var.vpc_subnet_ids != null && var.vpc_security_group_ids != null ? [true] : [] @@ -87,7 +87,7 @@ resource "aws_lambda_function" "executor" { # source_code_hash = "${base64sha256(file("lambda_function_payload.zip"))}" source_code_hash = data.archive_file.app.output_base64sha256 - runtime = "nodejs16.x" + runtime = "nodejs20.x" dynamic "vpc_config" { for_each = var.vpc_subnet_ids != null && var.vpc_security_group_ids != null ? [true] : [] @@ -124,7 +124,7 @@ resource "aws_lambda_function" "initializer" { # source_code_hash = "${base64sha256(file("lambda_function_payload.zip"))}" source_code_hash = data.archive_file.app.output_base64sha256 - runtime = "nodejs16.x" + runtime = "nodejs20.x" dynamic "vpc_config" { for_each = var.vpc_subnet_ids != null && var.vpc_security_group_ids != null ? [true] : [] @@ -161,7 +161,7 @@ resource "aws_lambda_function" "optimizer" { # source_code_hash = "${base64sha256(file("lambda_function_payload.zip"))}" source_code_hash = data.archive_file.app.output_base64sha256 - runtime = "nodejs16.x" + runtime = "nodejs20.x" dynamic "vpc_config" { for_each = var.vpc_subnet_ids != null && var.vpc_security_group_ids != null ? [true] : [] @@ -190,7 +190,7 @@ resource "aws_lambda_layer_version" "lambda_layer" { layer_name = "AWS-SDK-v2_1134_0" description = "AWS SDK 2.1134.0" compatible_architectures = ["x86_64"] - compatible_runtimes = ["nodejs16.x"] + compatible_runtimes = ["nodejs20.x"] depends_on = [data.archive_file.layer] }