Skip to content

Commit

Permalink
adding nodejs22 runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
Vandita2020 committed Nov 13, 2024
1 parent b763d86 commit 9f63122
Show file tree
Hide file tree
Showing 6 changed files with 187 additions and 3 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,56 @@
"DependsOn": [
"NODEJS20XServiceRole188A4E38"
]
},
"NODEJS22XServiceRole8FE2F7A5": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "lambda.amazonaws.com"
}
}
],
"Version": "2012-10-17"
},
"ManagedPolicyArns": [
{
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
]
]
}
]
}
},
"NODEJS22X911196A1": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Code": {
"ZipFile": "exports.handler = async function(event) { return \"success\" }"
},
"Handler": "index.handler",
"Role": {
"Fn::GetAtt": [
"NODEJS22XServiceRole8FE2F7A5",
"Arn"
]
},
"Runtime": "nodejs22.x"
},
"DependsOn": [
"NODEJS22XServiceRole8FE2F7A5"
]
}
},
"Outputs": {
Expand Down Expand Up @@ -386,6 +436,11 @@
"Value": {
"Ref": "NODEJS20X70A25ADE"
}
},
"NODEJS22XfunctionName": {
"Value": {
"Ref": "NODEJS22X911196A1"
}
}
},
"Parameters": {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ const node20xfn = new Function(stack, 'NODEJS_20_X', {
});
new CfnOutput(stack, 'NODEJS_20_X-functionName', { value: node20xfn.functionName });

const node22xfn = new Function(stack, 'NODEJS_22_X', {
code: new InlineCode('exports.handler = async function(event) { return "success" }'),
handler: 'index.handler',
runtime: Runtime.NODEJS_22_X,
});
new CfnOutput(stack, 'NODEJS_22_X-functionName', { value: node22xfn.functionName });

new integ.IntegTest(app, 'lambda-runtime-inlinecode', {
testCases: [stack],
});
5 changes: 5 additions & 0 deletions packages/aws-cdk-lib/aws-lambda/lib/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ export class Runtime {
*/
public static readonly NODEJS_LATEST = new Runtime('nodejs18.x', RuntimeFamily.NODEJS, { supportsInlineCode: true, isVariable: true });

/**
* The NodeJS 22.x runtime (nodejs22.x)
*/
public static readonly NODEJS_22_X = new Runtime('nodejs22.x', RuntimeFamily.NODEJS, { supportsInlineCode: true });

/**
* The Python 2.7 runtime (python2.7)
* @deprecated Legacy runtime no longer supported by AWS Lambda. Migrate to the latest Python runtime.
Expand Down

0 comments on commit 9f63122

Please sign in to comment.