Skip to content

Commit 2d32163

Browse files
9paceaws-amplify-botsvidgen
authored
chore: upgrade to node 24 (#3379)
<!-- Please make sure to read the Pull Request Guidelines: https://github.com/aws-amplify/amplify-cli/blob/master/CONTRIBUTING.md#pull-requests --> #### Description of changes Update lambda runtime / node dependencies to node 24. Also upload sdk deps in related packages to most recent version. Upgrade knex dependency for compatibility. Upgraded `aws-cdk-lib` to 2.224.0 which is the oldest version of `aws-cdk-lib` that has access to Node 24 lambda functions (and locked to that version for now). Upgraded `jsii` to 5.7.0 for compatibility with Node 24. Node 24 Lambda functions do not support callback-based handler signatures and force the use of async/await which lead to some tests getting changed (https://aws.amazon.com/blogs/compute/node-js-24-runtime-now-available-in-aws-lambda/). `aws-serverless-express` is dead and has been replace by its successor `@codegenie/serverless-express`. <!-- Thank you for your Pull Request! Please provide a description above and review the requirements below. --> ##### CDK / CloudFormation Parameters Changed <!-- Please list any changes to the CDK/CFN params, with a link to references https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html e.g. * Conditionally added support for `Code` based AppSync Functions: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-functionconfiguration.html#cfn-appsync-functionconfiguration-code * Conditionally added support for `Code` based AppSync Resolvers: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-resolver.html#cfn-appsync-resolver-code --> #### Issue #, if available <!-- Also, please reference any associated PRs for documentation updates. --> #### Description of how you validated changes #### Checklist <!-- Remove items that do not apply. For completed items, change [ ] to [x]. --> - [x] PR description included - [x] `yarn test` passes - [x] E2E test run linked - [x] Tests are [changed or added](https://github.com/aws-amplify/amplify-cli/blob/master/CONTRIBUTING.md#tests) - [ ] Relevant documentation is changed or added (and PR referenced) - [ ] New AWS SDK calls or CloudFormation actions have been added to relevant test and service IAM policies - [ ] Any CDK or CloudFormation parameter changes are called out explicitly By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Co-authored-by: aws-amplify-bot <aws@amazon.com> Co-authored-by: Jon Wire <iambipedal@gmail.com>
1 parent d986592 commit 2d32163

54 files changed

Lines changed: 2159 additions & 1091 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ This section should get you running with **Amplify API Category** and get you fa
3939

4040
> If you are using Yarn v2, run `yarn set version classic` to change to Yarn Classic.
4141
>
42-
> Note: Ensure that the version of Node installed is v20.x. During the installation process, some modules may not be compatible with other versions of Node.
42+
> Note: Ensure that the version of Node installed is v24.x. During the installation process, some modules may not be compatible with other versions of Node.
4343
4444
1. Ensure you are using the npm registry, even with yarn by running `yarn config set registry https://registry.npmjs.org`
4545

client-test-apps/js/api-model-relationship-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"@types/ini": "^1.3.31",
1212
"@types/jest": "^27.5.2",
1313
"@types/jest-dev-server": "^5.0.0",
14-
"@types/node": "^20.0.0",
14+
"@types/node": "^24.0.0",
1515
"@types/react": "18.2.42",
1616
"@types/react-dom": "^18.0.6",
1717
"aws-amplify": "^4.3.30",

dependency_licenses.txt

Lines changed: 421 additions & 215 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@
419419
"**/istanbul/async": "^2.6.4",
420420
"**/jake/async": "^2.6.4",
421421
"**/nth-check": "^2.0.1",
422-
"aws-cdk-lib": "^2.187.0",
422+
"aws-cdk-lib": "2.224.0",
423423
"lodash": "^4.17.21",
424424
"node-fetch": "^2.6.7",
425425
"cross-fetch": "^2.2.6",

packages/amplify-data-construct/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -291,17 +291,17 @@
291291
},
292292
"devDependencies": {
293293
"@types/fs-extra": "^8.0.1",
294-
"@types/node": "^20.0.0",
295-
"aws-cdk-lib": "2.189.1",
294+
"@types/node": "^24.0.0",
295+
"aws-cdk-lib": "2.224.0",
296296
"constructs": "10.3.0",
297-
"jsii": "^5.4.23",
297+
"jsii": "^5.7.0",
298298
"jsii-pacmak": "^1.84.0",
299-
"jsii-rosetta": "^5.4.23",
299+
"jsii-rosetta": "^5.7.0",
300300
"rimraf": "^3.0.0",
301301
"ts-node": "^8.10.1"
302302
},
303303
"peerDependencies": {
304-
"aws-cdk-lib": "^2.187.0",
304+
"aws-cdk-lib": "^2.224.0",
305305
"constructs": "^10.3.0"
306306
},
307307
"stability": "stable",

packages/amplify-graphql-api-construct-tests/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
"@aws-amplify/graphql-transformer-core": "3.4.4",
5252
"@aws-amplify/graphql-transformer-interfaces": "4.2.6",
5353
"@aws-amplify/graphql-validate-transformer": "1.1.4",
54-
"@types/node": "^20.0.0",
55-
"aws-cdk-lib": "2.189.1",
54+
"@types/node": "^24.0.0",
55+
"aws-cdk-lib": "2.224.0",
5656
"constructs": "10.3.0",
5757
"ts-node": "^8.10.2"
5858
},

packages/amplify-graphql-api-construct-tests/src/__tests__/__snapshots__/base-cdk.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`CDK GraphQL Transformer CDK base case - aws-cdk-lib@2.187.0 1`] = `
3+
exports[`CDK GraphQL Transformer CDK base case - aws-cdk-lib@2.224.0 1`] = `
44
Object {
55
"body": Object {
66
"data": Object {
@@ -14,7 +14,7 @@ Object {
1414
}
1515
`;
1616
17-
exports[`CDK GraphQL Transformer CDK base case - aws-cdk-lib@2.187.0 2`] = `
17+
exports[`CDK GraphQL Transformer CDK base case - aws-cdk-lib@2.224.0 2`] = `
1818
Object {
1919
"body": Object {
2020
"data": Object {

packages/amplify-graphql-api-construct-tests/src/__tests__/admin-role.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe('CDK Auth Modes', () => {
2929
test('Can be invoked with Admin Roles defined', async () => {
3030
const templatePath = path.resolve(path.join(__dirname, 'backends', 'admin-role'));
3131
const name = await initCDKProject(projRoot, templatePath, {
32-
cdkVersion: '2.187.0', // Explicitly declaring this, since this version needs to match cognito idp
32+
cdkVersion: '2.224.0', // Explicitly declaring this, since this version needs to match cognito idp
3333
additionalDependencies: [
3434
'esbuild', // required to bundle the lambda function
3535
'@aws-crypto/sha256-js', // All remaining deps are required for the lambda to sign the request to appsync

packages/amplify-graphql-api-construct-tests/src/__tests__/backends/admin-role/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ executionRole.applyRemovalPolicy(RemovalPolicy.DESTROY);
3636

3737
const apiInvoker = new NodejsFunction(stack, 'ApiInvoker', {
3838
entry: path.join(__dirname, 'apiInvoker.ts'),
39-
runtime: Runtime.NODEJS_20_X,
39+
runtime: Runtime.NODEJS_24_X,
4040
role: executionRole,
4141
bundling: {
4242
nodeModules: ['@smithy/util-utf8'], // Force inclusion

packages/amplify-graphql-api-construct-tests/src/__tests__/backends/sql-configurable-stack/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ const createUserPoolTriggers = (triggers: Record<string, string>): UserPoolTrigg
213213

214214
const createLambdaFunction = (name: string, code: string): Function => {
215215
return new Function(stack, `${name}Lambda`, {
216-
runtime: Runtime.NODEJS_20_X,
216+
runtime: Runtime.NODEJS_24_X,
217217
handler: 'index.handler',
218218
code: Code.fromInline(code),
219219
});

0 commit comments

Comments
 (0)