feat(aws-rfdk): update Lambda functions to use Node.js 18 #1224
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The RFDK's Lambda functions use Node.js 16, which was deprecated on June 12, 2024.
Solution
Update the Lambda functions to use Node.js 18.
Also:
aws-sdk-mock
. However, this library doesn't support the AWS SDK for JavaScript v3, so we changed our tests to useaws-sdk-client-mock
which does.Date
.Testing
I tested the Lambdas by deploying the All-In-AWS-Infrastructure-Basic example, and by running the integration tests. Here is a list of Node.js Lambdas that I found in this project, and how I tested them:
logGroupProps
toMongoDbInstance
andRenderQueue
.StorageStruct3/MongoDB/Server
instance had a static ENI attached. Terminated the instance, and confirmed that its replacement had the same static ENI attached.I confirmed that all of the Lambdas listed above now use the Node.js 18 runtime.
Tested the lambda-layers by following the steps in the README.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license