Skip to content

Upgrade Lambda runtime from 18 to 22#6

Merged
plumdog merged 1 commit intomainfrom
upgrade-lambda-runtime
Jul 2, 2025
Merged

Upgrade Lambda runtime from 18 to 22#6
plumdog merged 1 commit intomainfrom
upgrade-lambda-runtime

Conversation

@plumdog
Copy link
Contributor

@plumdog plumdog commented Jul 2, 2025

No description provided.

@plumdog plumdog requested a review from Copilot July 2, 2025 09:57
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

The PR upgrades AWS Lambda functions to use the Node.js 22.x runtime with inline code support.

  • Replaces lambda.Runtime.NODEJS_18_X with a custom lambda.Runtime('nodejs22.x', ...) instantiation for two handlers.
  • Enables supportsInlineCode to leverage the new inline Lambda feature.

const handler = new lambda.Function(this, 'OnEvent', {
code: lambda.Code.fromAsset(pathlib.join(__dirname, 'handler')),
runtime: lambda.Runtime.NODEJS_18_X,
runtime: new lambda.Runtime('nodejs22.x', lambda.RuntimeFamily.NODEJS, { supportsInlineCode: true }),
Copy link

Copilot AI Jul 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] If your CDK version supports it, consider using the built-in lambda.Runtime.NODEJS_22_X constant instead of manually constructing a new Runtime for improved readability and consistency.

Suggested change
runtime: new lambda.Runtime('nodejs22.x', lambda.RuntimeFamily.NODEJS, { supportsInlineCode: true }),
runtime: lambda.Runtime.NODEJS_22_X,

Copilot uses AI. Check for mistakes.
const handler = new lambda.Function(this, 'OnEvent', {
code: lambda.Code.fromAsset(pathlib.join(__dirname, 'handler')),
runtime: lambda.Runtime.NODEJS_18_X,
runtime: new lambda.Runtime('nodejs22.x', lambda.RuntimeFamily.NODEJS, { supportsInlineCode: true }),
Copy link

Copilot AI Jul 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The new lambda.Runtime(...) expression is duplicated; extract it into a shared constant (e.g. const nodeJs22Inline = new lambda.Runtime(...)) to reduce repetition and simplify future updates.

Suggested change
runtime: new lambda.Runtime('nodejs22.x', lambda.RuntimeFamily.NODEJS, { supportsInlineCode: true }),
runtime: nodeJs22Inline,

Copilot uses AI. Check for mistakes.
@plumdog plumdog merged commit 3a93c99 into main Jul 2, 2025
1 check passed
@plumdog plumdog deleted the upgrade-lambda-runtime branch July 2, 2025 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments