Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws-cdk-lib: NODEJS_LATEST still points to nodejs18.x #28125

Open
MunchyYDL opened this issue Nov 24, 2023 · 10 comments
Open

aws-cdk-lib: NODEJS_LATEST still points to nodejs18.x #28125

MunchyYDL opened this issue Nov 24, 2023 · 10 comments
Assignees
Labels
@aws-cdk/aws-lambda Related to AWS Lambda bug This issue is a bug. effort/medium Medium work item – several days of effort p1

Comments

@MunchyYDL
Copy link

Describe the bug

NODEJS_LATEST points to nodejs18.x even though nodejs20.x is available.

Not exactly sure if this should be considered a bug or a feature request?

I tried searching for any information regarding if the NODEJS_LATEST value change should be delayed because of some reason but couldn't find anything. Tried to ask about it here as well #28046, but haven't received any response there yet.

Expected Behavior

NODEJS_LATEST should return nodejs20.x

Current Behavior

NODEJS_LATEST returns nodejs18.x
This is where you can find the code: aws-cdk-lib/aws-lambda/lib/runtime.js

  /**
   * The latest NodeJS version currently available
   */
  public static readonly NODEJS_LATEST = new Runtime('nodejs18.x', RuntimeFamily.NODEJS, { supportsInlineCode: true, isVariable: true });

Reproduction Steps

Just use the NODEJS_LATEST

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.110.1 (build 0d37f0d)

Framework Version

No response

Node.js Version

v20.9.0

OS

macOS

Language

TypeScript

Language Version

TypeScript v5.2.2

Other information

No response

@MunchyYDL MunchyYDL added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 24, 2023
@github-actions github-actions bot added the aws-cdk-lib Related to the aws-cdk-lib package label Nov 24, 2023
@khushail
Copy link
Contributor

khushail commented Nov 24, 2023

Hi @MunchyYDL , Thnaks for reaching out. There is already work being done on upgrading the lambda runtime to NodeJS20 as the latest. It is being tracked here.

@khushail khushail added p1 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Nov 25, 2023
@MunchyYDL
Copy link
Author

HI @khushail, thanks for the information, I will close my own attempts to fix this then, and leave it to you guys! 👍

Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@kaizencc kaizencc reopened this Nov 28, 2023
@kaizencc
Copy link
Contributor

Reopening this because #27003 tracks CDK's transition from node18 to node20 in our underlying custom resources. This ticket tracks NODEJS_LATEST's move to node20, which will happen when the runtime exists in all regions.

@MunchyYDL
Copy link
Author

Sorry, I thought you meant that there were other issues tracking this, I just wanted to clean up after myself.

And oh, do you have any more information about when nodejs20.x will be available in all regions, as my impressions from this article: Node.js 20.x runtime now available in AWS Lambda, was that it was available everywhere. 🤔
Or do you know where I can find more information about it?

That was actually some of my initial concerns, that I couldn't find any rules about if NODEJS_LATEST was supposed to still point to nodejs18.x or not.

@unstubbable
Copy link
Contributor

@kaizencc Is this still on your radar? Also, I can't find any info that Node 20 is only available in certain regions (e.g. https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html, or https://aws.amazon.com/blogs/compute/node-js-20-x-runtime-now-available-in-aws-lambda/). Can you confirm that this is still the case, and maybe point me to a source?

@scanlonp
Copy link
Contributor

Hey @MunchyYDL and @unstubbable, this blog post is where I see a reference to Node 20 not being available in all regions.

Thank you for bringing this issue up, and it is on our radar. We have some ideas on making NODEJS_LATEST represent the latest version rather than the "latest available in all regions". I think it would be better for my mental model of what the variable does, but let me know your thoughts! And we will update you with what decisions we make.

@automartin5000
Copy link

Hey @MunchyYDL and @unstubbable, this blog post is where I see a reference to Node 20 not being available in all regions.

Thank you for bringing this issue up, and it is on our radar. We have some ideas on making NODEJS_LATEST represent the latest version rather than the "latest available in all regions". I think it would be better for my mental model of what the variable does, but let me know your thoughts! And we will update you with what decisions we make.

Selfishly, I'd want NODEJS_LATEST to always point to the latest runtime available in most regions, especially not including GovCloud or China. That said, I could see the broad usefulness of the variable to ensure random Lambda functions, like custom resources, that don't get updated much, are always on at least a supported version.

Given that, I might suggest a new variable: NODEJS_LATEST_GLOBAL that is available for all regions and NODEJS_LATEST that is the most commonly available latest. Alternatively, you could create a variable specially for not 100% available latest, if you're trying to prevent a breaking change. I just can't think of what that would be called off the top of my head. Maybe NODEJS_BLEEDING_EDGE? 😏

@colifran
Copy link
Contributor

@automartin5000 I'm working on a PR that adds region awareness for node runtimes to our custom resources. I think it would make sense to point NODEJS_LATEST at this as well. We will be maintaining a fact table that keeps track of the latest node runtime available based on partition.

@pahud pahud added the @aws-cdk/aws-lambda Related to AWS Lambda label Jun 11, 2024
@moelasmar moelasmar removed the aws-cdk-lib Related to the aws-cdk-lib package label Aug 28, 2024
@michael-k
Copy link
Contributor

The nodejs20.x runtime is now (since 2024-09-23) available in the gov cloud: https://aws.amazon.com/about-aws/whats-new/2024/09/aws-lambda-linux-2023-runtimes-govcloud-regions/

Found no public information about the china regions 🤷

Region awareness for (node) runtimes would be great though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-lambda Related to AWS Lambda bug This issue is a bug. effort/medium Medium work item – several days of effort p1
Projects
None yet
10 participants