Skip to content

Commit

Permalink
Updating lambda functions to nodejs 20
Browse files Browse the repository at this point in the history
  • Loading branch information
mettke committed Dec 24, 2023
1 parent 53e440a commit d163378
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
- 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 }}
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -24,4 +24,4 @@ jobs:
- name: Coveralls
uses: coverallsapp/github-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions terraform/module/lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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] : []
Expand Down Expand Up @@ -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] : []
Expand Down Expand Up @@ -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] : []
Expand Down Expand Up @@ -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] : []
Expand Down Expand Up @@ -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] : []
Expand Down Expand Up @@ -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]
}
Expand Down

0 comments on commit d163378

Please sign in to comment.