Skip to content

Commit

Permalink
upgrade nodejs runtime to 20
Browse files Browse the repository at this point in the history
  • Loading branch information
hayk-simonyan committed Aug 6, 2024
1 parent 34b3ce8 commit 451bf0f
Show file tree
Hide file tree
Showing 10 changed files with 7,556 additions and 1,119 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ defaults:
docker: &default
working_directory: ~/builds
docker:
- image: circleci/node:16
- image: circleci/node:20

jobs:
install-dependencies:
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
20
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ All scripts may make use of a `.lambda-tools-rc.json` file in the root of the pr
"name": "Project Name"
},
"lambda": {
"runtime": "nodejs16.x"
"runtime": "nodejs20.x"
},
"aws": {
"region": "us-east-1",
Expand Down
4 changes: 2 additions & 2 deletions lib/deploy/bundle-lambdas-step.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ module.exports = function(context) {
const zippedPath = path.resolve(basePath, lambda.name + '.zip');
const manifestPath = path.resolve(basePath, lambda.name + '.manifest.json');

const runtime = _.get(lambda, 'config.Properties.Runtime', 'nodejs16.x');
const runtime = _.get(lambda, 'config.Properties.Runtime', 'nodejs20.x');

return context.logger.task(lambda.name, function(resolve, reject) {
// First, bundle the code (this bundle will be used for the manifest etc)
Expand Down Expand Up @@ -264,7 +264,7 @@ module.exports = function(context) {

if (runtime === 'nodejs') {
options.presets = [es2015presets];
} else if (runtime === 'nodejs16.x') {
} else if (runtime === 'nodejs20.x') {
options.presets = [nodePresets];
}

Expand Down
2 changes: 1 addition & 1 deletion lib/deploy/templates/lambda.cf.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"Handler": "index.handler",
"MemorySize": 256,
"Role": { "Fn::GetAtt": ["IamRoleLambda", "Arn"] },
"Runtime": "nodejs16.x",
"Runtime": "nodejs20.x",
"Timeout": 6
}
}
2 changes: 1 addition & 1 deletion lib/helpers/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const resourceNamePrefix = _.compact([conf.get('ResourcePrefix'), pkg.name, majo
let result = {
project: {},
lambda: {
runtime: 'nodejs16.x'
runtime: 'nodejs20.x'
},
aws: {
region: 'us-east-1',
Expand Down
4 changes: 2 additions & 2 deletions lib/setup/create-cf-resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function updateOrCreateFunction(name, code, role) {
return new Promise(function(resolve, reject) {
lambda.updateFunctionConfiguration({
FunctionName: name,
Runtime: 'nodejs16.x'
Runtime: 'nodejs20.x'
}, function(err) {
if (err) return reject(err);
resolve(result);
Expand All @@ -119,7 +119,7 @@ function updateOrCreateFunction(name, code, role) {
lambda.createFunction({
FunctionName: name,
Handler: 'index.handler',
Runtime: 'nodejs16.x',
Runtime: 'nodejs20.x',
Role: role.Arn,
MemorySize: 256,
Publish: true,
Expand Down
Loading

0 comments on commit 451bf0f

Please sign in to comment.