Skip to content

Commit

Permalink
add nodejs20.x runtime key
Browse files Browse the repository at this point in the history
also added unit test for a function using that runtime
  • Loading branch information
duncanista committed Nov 27, 2023
1 parent 48e7758 commit e2f8dde
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions serverless/src/layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export const runtimeLookup: { [key: string]: RuntimeType } = {
"nodejs14.x": RuntimeType.NODE,
"nodejs16.x": RuntimeType.NODE,
"nodejs18.x": RuntimeType.NODE,
"nodejs20.x": RuntimeType.NODE,
"python2.7": RuntimeType.PYTHON,
"python3.6": RuntimeType.PYTHON,
"python3.7": RuntimeType.PYTHON,
Expand All @@ -57,6 +58,7 @@ function runtimeToLayerName(runtime: string, architecture: string): string {
"nodejs14.x": "Datadog-Node14-x",
"nodejs16.x": "Datadog-Node16-x",
"nodejs18.x": "Datadog-Node18-x",
"nodejs20.x": "Datadog-Node20-x",
};

const pythonLookup: { [key: string]: string } = {
Expand Down
2 changes: 2 additions & 0 deletions serverless/test/layer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ describe("findLambdas", () => {
Node14Function: mockFunctionResource("nodejs14.x", ["x86_64"]),
Node16Function: mockFunctionResource("nodejs16.x", ["x86_64"]),
Node18Function: mockFunctionResource("nodejs18.x", ["x86_64"]),
Node20Function: mockFunctionResource("nodejs20.x", ["x86_64"]),
Python27Function: mockFunctionResource("python2.7", ["x86_64"]),
Python36Function: mockFunctionResource("python3.6", ["x86_64"]),
Python37Function: mockFunctionResource("python3.7", ["x86_64"]),
Expand All @@ -71,6 +72,7 @@ describe("findLambdas", () => {
mockLambdaFunction("Node14Function", "nodejs14.x", RuntimeType.NODE, "x86_64", ArchitectureType.x86_64),
mockLambdaFunction("Node16Function", "nodejs16.x", RuntimeType.NODE, "x86_64", ArchitectureType.x86_64),
mockLambdaFunction("Node18Function", "nodejs18.x", RuntimeType.NODE, "x86_64", ArchitectureType.x86_64),
mockLambdaFunction("Node20Function", "nodejs20.x", RuntimeType.NODE, "x86_64", ArchitectureType.x86_64),
mockLambdaFunction("Python27Function", "python2.7", RuntimeType.PYTHON, "x86_64", ArchitectureType.x86_64),
mockLambdaFunction("Python36Function", "python3.6", RuntimeType.PYTHON, "x86_64", ArchitectureType.x86_64),
mockLambdaFunction("Python37Function", "python3.7", RuntimeType.PYTHON, "x86_64", ArchitectureType.x86_64),
Expand Down

0 comments on commit e2f8dde

Please sign in to comment.