Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add NodeJS 20 support for Lambda #9659

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion localstack/services/lambda_/api_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
Runtime.nodejs14_x,
Runtime.nodejs16_x,
Runtime.nodejs18_x,
Runtime.nodejs20_x,
Runtime.python3_7,
Runtime.python3_8,
Runtime.python3_9,
Expand Down Expand Up @@ -629,7 +630,7 @@ def validate_layer_runtimes_and_architectures(
validations = []

if compatible_runtimes and set(compatible_runtimes).difference(RUNTIMES):
constraint = "Member must satisfy enum value set: [java17, provided, nodejs16.x, nodejs14.x, ruby2.7, python3.10, java11, python3.11, dotnet6, go1.x, nodejs18.x, provided.al2, java8, java8.al2, ruby3.2, python3.7, python3.8, python3.9]"
constraint = "Member must satisfy enum value set: [java17, provided, nodejs16.x, nodejs14.x, ruby2.7, python3.10, java11, python3.11, dotnet6, go1.x, nodejs18.x, provided.al2, java8, java8.al2, ruby3.2, python3.7, python3.8, python3.9, nodejs20.x]"
validation_msg = f"Value '[{', '.join([s for s in compatible_runtimes])}]' at 'compatibleRuntimes' failed to satisfy constraint: {constraint}"
validations.append(validation_msg)

Expand Down
1 change: 1 addition & 0 deletions localstack/services/lambda_/invocation/lambda_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"nodejs14.x": "nodejs:14",
"nodejs16.x": "nodejs:16",
"nodejs18.x": "nodejs:18",
"nodejs20.x": "nodejs:20",
"ruby2.7": "ruby:2.7",
"ruby3.2": "ruby:3.2",
"java8": "java:8",
Expand Down
4 changes: 2 additions & 2 deletions localstack/services/lambda_/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ def create_function(
runtime = request.get("Runtime")
if package_type == PackageType.Zip and runtime not in IMAGE_MAPPING:
raise InvalidParameterValueException(
f"Value {request.get('Runtime')} at 'runtime' failed to satisfy constraint: Member must satisfy enum value set: [java17, provided, nodejs16.x, nodejs14.x, ruby2.7, python3.10, java11, python3.11, dotnet6, go1.x, nodejs18.x, provided.al2, java8, java8.al2, ruby3.2, python3.7, python3.8, python3.9] or be a valid ARN",
f"Value {request.get('Runtime')} at 'runtime' failed to satisfy constraint: Member must satisfy enum value set: [java17, provided, nodejs16.x, nodejs14.x, ruby2.7, python3.10, java11, python3.11, dotnet6, go1.x, nodejs18.x, provided.al2, java8, java8.al2, ruby3.2, python3.7, python3.8, python3.9, nodejs20.x] or be a valid ARN",
Type="User",
)
if snap_start := request.get("SnapStart"):
Expand Down Expand Up @@ -944,7 +944,7 @@ def update_function_configuration(
if "Runtime" in request:
if request["Runtime"] not in IMAGE_MAPPING:
raise InvalidParameterValueException(
f"Value {request.get('Runtime')} at 'runtime' failed to satisfy constraint: Member must satisfy enum value set: [java17, provided, nodejs16.x, nodejs14.x, ruby2.7, python3.10, java11, python3.11, dotnet6, go1.x, nodejs18.x, provided.al2, java8, java8.al2, ruby3.2, python3.7, python3.8, python3.9] or be a valid ARN",
f"Value {request.get('Runtime')} at 'runtime' failed to satisfy constraint: Member must satisfy enum value set: [java17, provided, nodejs16.x, nodejs14.x, ruby2.7, python3.10, java11, python3.11, dotnet6, go1.x, nodejs18.x, provided.al2, java8, java8.al2, ruby3.2, python3.7, python3.8, python3.9, nodejs20.x] or be a valid ARN",
Type="User",
)
replace_kwargs["runtime"] = request["Runtime"]
Expand Down
2 changes: 1 addition & 1 deletion localstack/testing/aws/lambda_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
Runtime.python3_10,
Runtime.python3_11,
],
"nodejs": [Runtime.nodejs14_x, Runtime.nodejs16_x, Runtime.nodejs18_x],
"nodejs": [Runtime.nodejs14_x, Runtime.nodejs16_x, Runtime.nodejs18_x, Runtime.nodejs20_x],
"ruby": [Runtime.ruby2_7, Runtime.ruby3_2],
"java": [Runtime.java8, Runtime.java8_al2, Runtime.java11, Runtime.java17],
"dotnet": [Runtime.dotnet6],
Expand Down