AWS Nodejs14.x is no longer supported

Suppose you run into this exception while deploying your infrastructure using CDK v1 code to AWS:

The runtime parameter of nodejs14.x is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs20.x) while creating or updating functions.

And you think: wait, I don’t have any lambdas, why do I keep receiving this?

The thing is that CDK v1 implicitly creates lambda functions to support some functionality. For example, when you create S3 bucket this way:

const bucket = new Bucket(this, 'RunCommandBucket', {
autoDeleteObjects: true,

CDK v1 implicitly creates Lambda function with hardcoded runtime of NODEJS_14_X. Have a look at the sources here:

Another example is when you create a Dynamo table:

const dynamoTable = new Table(this, 'MyDynamoDBTable', {
  1. CDK v1 main DynamoDB construction class creates new ReplicaProvider here
  2. ReplicaProvider creates even two lambdas with hardcoded NODEJS_14_X runtime version:

So the possible solutions may be:

  1. Upgrade to CDK v2. Select the latest version, since not all CDK v2 versions have this fix.
  2. Move infra to terraform or something.
  3. Consider leveraging some dark JS magic outside of Hogwarts to replace these constants (kind of runtime-monkey-patching); for sure, this is risky and unstable approach.
  4. Remove all code from your CDK v1 that implicitly creates lambda functions (again, it’s at least S3 buckets and Dynamo tables creation).

That’s all.

Telegram channel

If you still have any questions, feel free to ask me in the comments under this article or write me at

If I saved your day, you can support me 🤝

Leave a Reply

Your email address will not be published. Required fields are marked *