Skip to content

Upgrade Lambda runtime from 18 to 22#9

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

Upgrade Lambda runtime from 18 to 22#9
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:58
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

Upgrade the AWS Lambda runtime from Node.js 18.x to 22.x for two handlers in index.ts.

  • Replace lambda.Runtime.NODEJS_18_X with a custom Runtime instance targeting Node.js 22.x
  • Enable supportsInlineCode for the new runtime
  • Applies to both the OnEvent and OnEventSecretLatestVersion handlers

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] Consider using the built-in lambda.Runtime.NODEJS_22_X constant instead of manually instantiating a new Runtime for consistency and clarity.

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 secretLatestVersionHandler = new lambda.Function(this, 'OnEventSecretLatestVersion', {
code: lambda.Code.fromAsset(pathlib.join(__dirname, 'latest_secret_version_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] Consider using the built-in lambda.Runtime.NODEJS_22_X constant instead of manually instantiating a new Runtime for consistency and clarity.

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.
@plumdog plumdog merged commit 5a9e319 into main Jul 2, 2025
2 checks passed
@plumdog plumdog deleted the upgrade-lambda-runtime branch July 2, 2025 10:00
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