diff --git a/CHANGELOG.md b/CHANGELOG.md index f734ab9e4..8277d5355 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## Release 2026-02-04 + +### Amazon.Lambda.Core (2.8.1) +* Add the InternalsVisibleToAttribute to the renamed version of Amazon.Lambda.RuntimeSupport embedded with the Lambda Test Tool +### Amazon.Lambda.RuntimeSupport (1.14.2) +* Add defensive checks for scenarios where a Lambda function uses an older Amazon.Lambda.Core together with the renamed Amazon.Lambda.RuntimeSupport.TestTool assembly embedded in the Lambda Test Tool +### Amazon.Lambda.TestTool (0.12.0) +* Rename embedded Amazon.Lambda.RuntimeSupport assembly to Amazon.Lambda.RuntimeSupport.TestTool to avoid conflicts with Lambda function that might include Amazon.Lambda.RuntimeSupport + ## Release 2026-01-30 ### Amazon.Lambda.TestTool.BlazorTester (0.17.0) diff --git a/LambdaRuntimeDockerfiles/Images/net10/amd64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net10/amd64/Dockerfile index c78cffb88..1c8d48185 100644 --- a/LambdaRuntimeDockerfiles/Images/net10/amd64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net10/amd64/Dockerfile @@ -8,7 +8,7 @@ ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023 FROM $AMAZON_LINUX AS base -RUN dnf install libicu-67.1-7.amzn2023.0.3.x86_64 --assumeyes +RUN dnf install libicu-67.1-7.amzn2023.0.4.x86_64 --assumeyes FROM base AS builder-net10 ARG ASPNET_VERSION diff --git a/LambdaRuntimeDockerfiles/Images/net10/arm64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net10/arm64/Dockerfile index 615c29222..ebfa9f219 100644 --- a/LambdaRuntimeDockerfiles/Images/net10/arm64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net10/arm64/Dockerfile @@ -8,7 +8,7 @@ ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023 FROM $AMAZON_LINUX AS base -RUN dnf install libicu-67.1-7.amzn2023.0.3.aarch64 --assumeyes +RUN dnf install libicu-67.1-7.amzn2023.0.4.aarch64 --assumeyes FROM base AS builder-net10 ARG ASPNET_VERSION diff --git a/LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile index 359a42d03..d77988622 100644 --- a/LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile @@ -8,7 +8,7 @@ ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023 FROM $AMAZON_LINUX AS base -RUN dnf install libicu-67.1-7.amzn2023.0.3.x86_64 --assumeyes +RUN dnf install libicu-67.1-7.amzn2023.0.4.x86_64 --assumeyes FROM base AS builder-net8 ARG ASPNET_VERSION diff --git a/LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile index ea2cdbe45..ae1a5bcd9 100644 --- a/LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile @@ -8,7 +8,7 @@ ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023 FROM $AMAZON_LINUX AS base -RUN dnf install libicu-67.1-7.amzn2023.0.3.aarch64 --assumeyes +RUN dnf install libicu-67.1-7.amzn2023.0.4.aarch64 --assumeyes FROM base AS builder-net8 ARG ASPNET_VERSION diff --git a/LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile index a23676dfd..b100be748 100644 --- a/LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile @@ -8,7 +8,7 @@ ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023 FROM $AMAZON_LINUX AS base -RUN dnf install libicu-67.1-7.amzn2023.0.3.x86_64 --assumeyes +RUN dnf install libicu-67.1-7.amzn2023.0.4.x86_64 --assumeyes FROM base AS builder-net9 ARG ASPNET_VERSION diff --git a/LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile index 4e64e2080..ca665d114 100644 --- a/LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile @@ -8,7 +8,7 @@ ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023 FROM $AMAZON_LINUX AS base -RUN dnf install libicu-67.1-7.amzn2023.0.3.aarch64 --assumeyes +RUN dnf install libicu-67.1-7.amzn2023.0.4.aarch64 --assumeyes FROM base AS builder-net9 ARG ASPNET_VERSION diff --git a/Libraries/src/Amazon.Lambda.Core/Amazon.Lambda.Core.csproj b/Libraries/src/Amazon.Lambda.Core/Amazon.Lambda.Core.csproj index 7627b7992..580096c1f 100644 --- a/Libraries/src/Amazon.Lambda.Core/Amazon.Lambda.Core.csproj +++ b/Libraries/src/Amazon.Lambda.Core/Amazon.Lambda.Core.csproj @@ -6,7 +6,7 @@ netstandard2.0;net6.0;net8.0 Amazon Lambda .NET Core support - Core package. Amazon.Lambda.Core - 2.8.0 + 2.8.1 Amazon.Lambda.Core Amazon.Lambda.Core AWS;Amazon;Lambda @@ -18,6 +18,9 @@ <_Parameter1>Amazon.Lambda.RuntimeSupport, PublicKey="0024000004800000940000000602000000240000525341310004000001000100db5f59f098d27276c7833875a6263a3cc74ab17ba9a9df0b52aedbe7252745db7274d5271fd79c1f08f668ecfa8eaab5626fa76adc811d3c8fc55859b0d09d3bc0a84eecd0ba891f2b8a2fc55141cdcc37c2053d53491e650a479967c3622762977900eddbf1252ed08a2413f00a28f3a0752a81203f03ccb7f684db373518b4" + + <_Parameter1>Amazon.Lambda.RuntimeSupport.TestTool, PublicKey="0024000004800000940000000602000000240000525341310004000001000100db5f59f098d27276c7833875a6263a3cc74ab17ba9a9df0b52aedbe7252745db7274d5271fd79c1f08f668ecfa8eaab5626fa76adc811d3c8fc55859b0d09d3bc0a84eecd0ba891f2b8a2fc55141cdcc37c2053d53491e650a479967c3622762977900eddbf1252ed08a2413f00a28f3a0752a81203f03ccb7f684db373518b4" + <_Parameter1>Amazon.Lambda.RuntimeSupport.UnitTests, PublicKey="0024000004800000940000000602000000240000525341310004000001000100db5f59f098d27276c7833875a6263a3cc74ab17ba9a9df0b52aedbe7252745db7274d5271fd79c1f08f668ecfa8eaab5626fa76adc811d3c8fc55859b0d09d3bc0a84eecd0ba891f2b8a2fc55141cdcc37c2053d53491e650a479967c3622762977900eddbf1252ed08a2413f00a28f3a0752a81203f03ccb7f684db373518b4" diff --git a/Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj b/Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj index b921afb9b..77b2a0057 100644 --- a/Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj +++ b/Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj @@ -4,10 +4,9 @@ netstandard2.0;net6.0;net8.0;net9.0;net10.0 - 1.14.1 + 1.14.2 Provides a bootstrap and Lambda Runtime API Client to help you to develop custom .NET Core Lambda Runtimes. Amazon.Lambda.RuntimeSupport - Amazon.Lambda.RuntimeSupport Amazon.Lambda.RuntimeSupport AWS;Amazon;Lambda README.md @@ -24,6 +23,13 @@ false + + $(AlternateAssemblyName) + + + Amazon.Lambda.RuntimeSupport + + Exe $(DefineConstants);ExecutableOutputType diff --git a/Libraries/src/Amazon.Lambda.RuntimeSupport/Bootstrap/LambdaBootstrap.cs b/Libraries/src/Amazon.Lambda.RuntimeSupport/Bootstrap/LambdaBootstrap.cs index 68247f7a8..0e00f3e7f 100644 --- a/Libraries/src/Amazon.Lambda.RuntimeSupport/Bootstrap/LambdaBootstrap.cs +++ b/Libraries/src/Amazon.Lambda.RuntimeSupport/Bootstrap/LambdaBootstrap.cs @@ -235,6 +235,18 @@ internal LambdaBootstrap(HttpClient httpClient, LambdaBootstrapHandler handler, { registry = SnapstartHelperCopySnapshotCallbacksIsolated.CopySnapshotCallbacks(); } + catch (MethodAccessException ex) + { + // This would happen with the Lambda test tool when the Amazon.Lambda.RuntimeSupport assembly + // was renamed when embedded into the test tool. The renamed assembly would cause this error + // since older versions Amazon.Lambda.Core used in the customer's function would not have provided + // access to the internals for the renamed assembly version. + Client.ConsoleLogger.FormattedWriteLine( + Amazon.Lambda.RuntimeSupport.Helpers.LogLevelLoggerWriter.LogLevel.Error.ToString(), + "Failed to retrieve snapshot hooks from Amazon.Lambda.Core.SnapshotRestore, " + + $"this can be fixed by updating the version of Amazon.Lambda.Core: {ex}", + null); + } catch (TypeLoadException ex) { Client.ConsoleLogger.FormattedWriteLine( @@ -441,6 +453,16 @@ private void SetInvocationTraceId(string traceId) { TraceProviderIsolated.SetCurrentTraceId(traceId); } + catch (MethodAccessException) + { + // This would happen with the Lambda test tool when the Amazon.Lambda.RuntimeSupport assembly + // was renamed when embedded into the test tool. The renamed assembly would cause this error + // since older versions Amazon.Lambda.Core used in the customer's function would not have provided + // access to the internals for the renamed assembly version. + _disableTraceProvider = true; + _logger.LogInformation("Failed to set the trace id on Amazon.Lambda.Core.LambdaTraceProvider due to the version of " + + "Amazon.Lambda.Core being provided by Lambda Function being out of date."); + } catch (TypeLoadException) { // Disable attempting to set trace id in the future. If we got a TypeLoadException then setting the @@ -448,7 +470,7 @@ private void SetInvocationTraceId(string traceId) _disableTraceProvider = true; _logger.LogInformation("Failed to set the trace id on Amazon.Lambda.Core.LambdaTraceProvider due to the version of " + "Amazon.Lambda.Core being provided by Lambda Function being out of date."); - } + } } } diff --git a/Tools/LambdaTestTool-v2/README.md b/Tools/LambdaTestTool-v2/README.md index 567bcd441..ba025aefa 100644 --- a/Tools/LambdaTestTool-v2/README.md +++ b/Tools/LambdaTestTool-v2/README.md @@ -268,7 +268,7 @@ Configure the Lambda function to use the test tool: "LambdaRuntimeClient_FunctionHandler": { "workingDirectory": ".\\bin\\$(Configuration)\\net8.0", "commandName": "Executable", - "commandLineArgs": "exec --depsfile ./MyLambdaFunction.deps.json --runtimeconfig ./MyLambdaFunction.runtimeconfig.json %USERPROFILE%/.dotnet/tools/.store/amazon.lambda.testtool/{TEST_TOOL_VERSION}/amazon.lambda.testtool/{TEST_TOOL_VERSION}/content/Amazon.Lambda.RuntimeSupport/{TARGET_FRAMEWORK}/Amazon.Lambda.RuntimeSupport.dll MyLambdaFunction::MyLambdaFunction.Function::Add", + "commandLineArgs": "exec --depsfile ./MyLambdaFunction.deps.json --runtimeconfig ./MyLambdaFunction.runtimeconfig.json %USERPROFILE%/.dotnet/tools/.store/amazon.lambda.testtool/{TEST_TOOL_VERSION}/amazon.lambda.testtool/{TEST_TOOL_VERSION}/content/Amazon.Lambda.RuntimeSupport/{TARGET_FRAMEWORK}/Amazon.Lambda.RuntimeSupport.TestTool.dll MyLambdaFunction::MyLambdaFunction.Function::Add", "executablePath": "dotnet", "environmentVariables": { "AWS_LAMBDA_RUNTIME_API": "localhost:5050/AddLambdaFunction" @@ -288,7 +288,8 @@ There are three variables you need to update in the launch settings: 2. `{TARGET_FRAMEWORK}` - Replace with your Lambda project's target framework version (e.g., `net8.0` in the example above) - This appears in two places: - The working directory: `.\\bin\\$(Configuration)\\{TARGET_FRAMEWORK}` - - The runtime support DLL path: `Amazon.Lambda.RuntimeSupport/{TARGET_FRAMEWORK}/Amazon.Lambda.RuntimeSupport.dll` + - The runtime support DLL path: `Amazon.Lambda.RuntimeSupport/{TARGET_FRAMEWORK}/Amazon.Lambda.RuntimeSupport.TestTool.dll` + - **Note: For the test tool the Amazon.Lambda.RuntimeSupport.dll assembly was renamed to Amazon.Lambda.RuntimeSupport.TestTool.dll to avoid conflicts with versions of Amazon.Lambda.RuntimeSupport used by the Lambda function itself.** 3. `{FUNCTION_HANDLER}` - Replace with your function's handler using the format: `::.::` - Example: `MyLambdaFunction::MyLambdaFunction.Function::Add` @@ -341,4 +342,4 @@ The Test Tool provides users with the ability to save Lambda requests for quick In order to enable saving requests, you will need to provide a storage path during the test tool startup. -You can use the command line argument `--config-storage-path ` to specify the storage path. \ No newline at end of file +You can use the command line argument `--config-storage-path ` to specify the storage path. diff --git a/Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Amazon.Lambda.TestTool.csproj b/Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Amazon.Lambda.TestTool.csproj index d8e87b598..571e346c2 100644 --- a/Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Amazon.Lambda.TestTool.csproj +++ b/Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Amazon.Lambda.TestTool.csproj @@ -15,7 +15,7 @@ true Amazon.Lambda.TestTool dotnet-lambda-test-tool - 0.11.1 + 0.12.0 NU5100 Major README.md @@ -47,7 +47,7 @@ - + diff --git a/Tools/LambdaTestTool-v2/tests/Amazon.Lambda.TestTool.UnitTests/PackagingTests.cs b/Tools/LambdaTestTool-v2/tests/Amazon.Lambda.TestTool.UnitTests/PackagingTests.cs index 0402506fa..d2051615e 100644 --- a/Tools/LambdaTestTool-v2/tests/Amazon.Lambda.TestTool.UnitTests/PackagingTests.cs +++ b/Tools/LambdaTestTool-v2/tests/Amazon.Lambda.TestTool.UnitTests/PackagingTests.cs @@ -144,9 +144,9 @@ public void VerifyPackageContentsHasRuntimeSupport() var essentialFiles = new[] { $"content/Amazon.Lambda.RuntimeSupport/{framework}/Amazon.Lambda.Core.dll", - $"content/Amazon.Lambda.RuntimeSupport/{framework}/Amazon.Lambda.RuntimeSupport.dll", - $"content/Amazon.Lambda.RuntimeSupport/{framework}/Amazon.Lambda.RuntimeSupport.deps.json", - $"content/Amazon.Lambda.RuntimeSupport/{framework}/Amazon.Lambda.RuntimeSupport.runtimeconfig.json" + $"content/Amazon.Lambda.RuntimeSupport/{framework}/Amazon.Lambda.RuntimeSupport.TestTool.dll", + $"content/Amazon.Lambda.RuntimeSupport/{framework}/Amazon.Lambda.RuntimeSupport.TestTool.deps.json", + $"content/Amazon.Lambda.RuntimeSupport/{framework}/Amazon.Lambda.RuntimeSupport.TestTool.runtimeconfig.json" }; var missingFiles = essentialFiles.Where(f => !frameworkFiles.Contains(f)).ToList();