Skip to content

Commit b2f9e5d

Browse files
author
Eugene Cheung
authored
fix: use latest Node.js runtime for utility Lambda functions (#634)
Node.js 18 will be blocked later this year. See https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html --- _By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license_
1 parent 911f5a0 commit b2f9e5d

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

lib/dashboard/widget/BitmapWidget.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class BitmapWidgetRenderingSupport extends Construct {
3434
"Custom Widget Render for Bitmap Widgets (cdk-monitoring-constructs)",
3535
handler: "index.handler",
3636
memorySize: 128,
37-
runtime: Runtime.NODEJS_18_X,
37+
runtime: Runtime.NODEJS_LATEST,
3838
timeout: Duration.seconds(60),
3939
logRetention: RetentionDays.ONE_DAY,
4040
});

lib/monitoring/aws-secretsmanager/SecretsManagerMetricsPublisher.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class SecretsManagerMetricsPublisher extends Construct {
3434
"Custom metrics publisher for SecretsManager Secrets (cdk-monitoring-constructs)",
3535
handler: "index.handler",
3636
memorySize: 128,
37-
runtime: Runtime.NODEJS_18_X,
37+
runtime: Runtime.NODEJS_LATEST,
3838
timeout: Duration.seconds(60),
3939
logRetention: RetentionDays.ONE_DAY,
4040
});

test/common/alarm/action/LambdaAlarmActionStrategy.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ test("snapshot test: Lambda function", () => {
99
const stack = new Stack();
1010
const onAlarmFunction = new Function(stack, "alarmLambda", {
1111
functionName: "DummyLambda",
12-
runtime: Runtime.NODEJS_18_X,
12+
runtime: Runtime.NODEJS_LATEST,
1313
code: InlineCode.fromInline("{}"),
1414
handler: "Dummy::handler",
1515
});
@@ -28,7 +28,7 @@ test("snapshot test: Lambda alias", () => {
2828
const stack = new Stack();
2929
const onAlarmFunction = new Function(stack, "alarmLambda", {
3030
functionName: "DummyLambda",
31-
runtime: Runtime.NODEJS_18_X,
31+
runtime: Runtime.NODEJS_LATEST,
3232
code: InlineCode.fromInline("{}"),
3333
handler: "Dummy::handler",
3434
});
@@ -48,7 +48,7 @@ test("snapshot test: Lambda version", () => {
4848
const stack = new Stack();
4949
const onAlarmFunction = new Function(stack, "alarmLambda", {
5050
functionName: "DummyLambda",
51-
runtime: Runtime.NODEJS_18_X,
51+
runtime: Runtime.NODEJS_LATEST,
5252
code: InlineCode.fromInline("{}"),
5353
handler: "Dummy::handler",
5454
});

test/dashboard/widget/CustomWidget.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ test("widget", () => {
88

99
const handler = new Function(stack, "Function", {
1010
// execution environment
11-
runtime: Runtime.NODEJS_18_X,
11+
runtime: Runtime.NODEJS_LATEST,
1212
// code loaded from "lambda" directory
1313
code: Code.fromInline(
1414
'exports.handler = function(event, ctx, cb) { return cb(null, "Hello World!"); }',

test/monitoring/aws-lambda/LambdaFunctionMonitoring.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ test("snapshot test: default iterator and no alarms", () => {
1919

2020
const lambdaFunction = new Function(stack, "Function", {
2121
functionName: "DummyLambda",
22-
runtime: Runtime.NODEJS_18_X,
22+
runtime: Runtime.NODEJS_LATEST,
2323
code: InlineCode.fromInline("{}"),
2424
handler: "Dummy::handler",
2525
});
@@ -49,7 +49,7 @@ test("snapshot test: non-iterator and no alarms", () => {
4949

5050
const lambdaFunction = new Function(stack, "Function", {
5151
functionName: "DummyLambda",
52-
runtime: Runtime.NODEJS_18_X,
52+
runtime: Runtime.NODEJS_LATEST,
5353
code: InlineCode.fromInline("{}"),
5454
handler: "Dummy::handler",
5555
});
@@ -72,7 +72,7 @@ test("snapshot test: all alarms", () => {
7272

7373
const lambdaFunction = new Function(stack, "Function", {
7474
functionName: "DummyLambda",
75-
runtime: Runtime.NODEJS_18_X,
75+
runtime: Runtime.NODEJS_LATEST,
7676
code: InlineCode.fromInline("{}"),
7777
handler: "Dummy::handler",
7878
});
@@ -190,7 +190,7 @@ test("snapshot test: all alarms", () => {
190190

191191
const lambdaFunction = new Function(stack, "Function", {
192192
functionName: "DummyLambda",
193-
runtime: Runtime.NODEJS_18_X,
193+
runtime: Runtime.NODEJS_LATEST,
194194
code: InlineCode.fromInline("{}"),
195195
handler: "Dummy::handler",
196196
layers: [
@@ -230,7 +230,7 @@ test("snapshot test: all alarms, alarmPrefix on error dedupeString", () => {
230230

231231
const lambdaFunction = new Function(stack, "Function", {
232232
functionName: "DummyLambda",
233-
runtime: Runtime.NODEJS_18_X,
233+
runtime: Runtime.NODEJS_LATEST,
234234
code: InlineCode.fromInline("{}"),
235235
handler: "Dummy::handler",
236236
});
@@ -376,7 +376,7 @@ test("snapshot test: all alarms, alarmPrefix on latency dedupeString", () => {
376376

377377
const lambdaFunction = new Function(stack, "Function", {
378378
functionName: "DummyLambda",
379-
runtime: Runtime.NODEJS_18_X,
379+
runtime: Runtime.NODEJS_LATEST,
380380
code: InlineCode.fromInline("{}"),
381381
handler: "Dummy::handler",
382382
});
@@ -519,7 +519,7 @@ test("throws error if attempting to create iterator age alarm if not an iterator
519519

520520
const lambdaFunction = new Function(stack, "Function", {
521521
functionName: "DummyLambda",
522-
runtime: Runtime.NODEJS_18_X,
522+
runtime: Runtime.NODEJS_LATEST,
523523
code: InlineCode.fromInline("{}"),
524524
handler: "Dummy::handler",
525525
});
@@ -549,7 +549,7 @@ test("throws error if attempting to create offsetLag alarm if not an offsetLag L
549549

550550
const lambdaFunction = new Function(stack, "Function", {
551551
functionName: "DummyLambda",
552-
runtime: Runtime.NODEJS_18_X,
552+
runtime: Runtime.NODEJS_LATEST,
553553
code: InlineCode.fromInline("{}"),
554554
handler: "Dummy::handler",
555555
});
@@ -578,7 +578,7 @@ test("doesn't create alarms for enhanced Lambda Insights metrics if not enabled"
578578

579579
const lambdaFunction = new Function(stack, "Function", {
580580
functionName: "DummyLambda",
581-
runtime: Runtime.NODEJS_18_X,
581+
runtime: Runtime.NODEJS_LATEST,
582582
code: InlineCode.fromInline("{}"),
583583
handler: "Dummy::handler",
584584
});

test/monitoring/aws-step-functions/StepFunctionLambdaIntegrationMonitoring.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ test("snapshot test: no alarms", () => {
1616

1717
const lambdaFunction = new Function(stack, "Function", {
1818
functionName: "DummyLambda",
19-
runtime: Runtime.NODEJS_18_X,
19+
runtime: Runtime.NODEJS_LATEST,
2020
code: InlineCode.fromInline("{}"),
2121
handler: "Dummy::handler",
2222
});
@@ -37,7 +37,7 @@ test("snapshot test: all alarms", () => {
3737

3838
const lambdaFunction = new Function(stack, "Function", {
3939
functionName: "DummyLambda",
40-
runtime: Runtime.NODEJS_18_X,
40+
runtime: Runtime.NODEJS_LATEST,
4141
code: InlineCode.fromInline("{}"),
4242
handler: "Dummy::handler",
4343
});

0 commit comments

Comments
 (0)