From 27c39c6523f8aa4324a4a84adb23fd7b7e1cb3f9 Mon Sep 17 00:00:00 2001 From: Javier Hernandez Date: Tue, 13 Dec 2022 16:16:48 +0000 Subject: [PATCH] lambda runtime to node18.x (#111) Co-authored-by: javier.ojeda --- .travis.yml | 2 +- babelrc-node.js | 8 ++++---- .../autotag_event_main-template.json | 2 +- .../autotag_event_main-template.rb | 2 +- .../autotag_event-template.json | 2 +- spec/autotag_spec.js | 7 +++++-- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7c713c5..42af85c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: node_js node_js: - - "14" + - "18" install: # Install deps - npm install diff --git a/babelrc-node.js b/babelrc-node.js index fcc8ce5..26edc70 100644 --- a/babelrc-node.js +++ b/babelrc-node.js @@ -1,8 +1,8 @@ module.exports = { - "presets": [["@babel/preset-env", { - "targets": { - "node": "14" + presets: [['@babel/preset-env', { + targets: { + node: '18' } }]], - "env": {} + env: {} }; diff --git a/cloud_formation/event_multi_region_template/autotag_event_main-template.json b/cloud_formation/event_multi_region_template/autotag_event_main-template.json index b8c0f88..9f07bac 100644 --- a/cloud_formation/event_multi_region_template/autotag_event_main-template.json +++ b/cloud_formation/event_multi_region_template/autotag_event_main-template.json @@ -93,7 +93,7 @@ "Arn" ] }, - "Runtime": "nodejs14.x", + "Runtime": "nodejs18.x", "Timeout": 120, "Environment": { "Variables": { diff --git a/cloud_formation/event_multi_region_template/autotag_event_main-template.rb b/cloud_formation/event_multi_region_template/autotag_event_main-template.rb index 48dff08..669d537 100755 --- a/cloud_formation/event_multi_region_template/autotag_event_main-template.rb +++ b/cloud_formation/event_multi_region_template/autotag_event_main-template.rb @@ -70,7 +70,7 @@ FunctionName: sub('${LambdaName}'), Handler: sub('autotag_event.handler'), Role: get_att('AutoTagExecutionRole', 'Arn'), - Runtime: 'nodejs14.x', + Runtime: 'nodejs18.x', # the ec2 instance worker will wait for up to 45 seconds for a # opsworks stack or autoscaling group to be tagged with the creator # in case the events come out of order diff --git a/cloud_formation/event_single_region_template/autotag_event-template.json b/cloud_formation/event_single_region_template/autotag_event-template.json index 84cf8a4..6adbf92 100644 --- a/cloud_formation/event_single_region_template/autotag_event-template.json +++ b/cloud_formation/event_single_region_template/autotag_event-template.json @@ -67,7 +67,7 @@ }, "Handler" : "autotag_event.handler", "Role" : { "Fn::GetAtt" : [ "AutoTagExecutionRole", "Arn" ] }, - "Runtime" : "nodejs14.x", + "Runtime" : "nodejs18.x", "Timeout" : 120, "Environment": { "Variables": { diff --git a/spec/autotag_spec.js b/spec/autotag_spec.js index aebf4ac..4a378f2 100644 --- a/spec/autotag_spec.js +++ b/spec/autotag_spec.js @@ -21,8 +21,11 @@ each(cloudTrailEventConfig, (value, key) => { describe('AutoTag index file', () => { beforeAll(() => { - requireMock('../src/aws_cloud_trail_event_listener', AwsCloudTrailListenerMock); - sut = require('../src/autotag_event.js'); // eslint-disable-line global-require + requireMock( + '../src/aws_cloud_trail_event_listener', + AwsCloudTrailListenerMock + ); + sut = require('../src/autotag_event'); // eslint-disable-line global-require }); afterAll(() => {