#Lambdas (Node 20.x EOL)

1 messages · Page 1 of 1 (latest)

fluid canyon
#

Hello Amplify Team,

We recently received the "[Action Required] AWS Lambda Node.js 20.x end-of-life" notification for our AWS Account.

We are using Amplify Gen 2. Updating our custom functions is straightforward (we just set the runtime to Node 22). However, we found that for the managed SQL Lambda created by defineData (connecting to our PostgreSQL database), there is no way to configure the runtime version.

The Issue: The defineData configuration does not expose a runtime or lambdaConfig property for the underlying SQL adapter lambda.

Technical Investigation: We dove into the node_modules to verify if this was configurable or hardcoded. We found that the runtime is explicitly hardcoded to NODEJS_20_X in the internal transformer logic, effectively preventing any update without a CDK override or a library patch.

Location of the "Hardcode": We tracked the logic down to the @aws-amplify/graphql-model-transformer package, which is used internally by data-construct.

Our Current Workaround: To unblock ourselves and comply with the EOL policy, we are forcing the runtime update using a CDK Override in our backend definition:

const dataStack = backend.data.resources.cfnResources.cfnGraphqlApi.stack;
dataStack.node.findAll().forEach((element) => {
  if (element instanceof CfnFunction) {
    element.runtime = 'nodejs22.x';
  }
});

Could you please expose a runtime configuration option within defineData (or update the default to a supported version) so we can manage this natively without relying on overrides?

Thank you.

icy kettle
#

Hey @fluid canyon ,
Thank you for the detailed report and investigation!

We appreciate you identifying the hardcoded NODEJS_20_X runtime in the @aws-amplify/graphql-model-transformer package and
providing the CDK override workaround.

The team will discuss this internally and get back to you.