Skip to content
Merged
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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion LambdaRuntimeDockerfiles/Images/net10/amd64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion LambdaRuntimeDockerfiles/Images/net10/arm64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion Libraries/src/Amazon.Lambda.Core/Amazon.Lambda.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<Description>Amazon Lambda .NET Core support - Core package.</Description>
<AssemblyTitle>Amazon.Lambda.Core</AssemblyTitle>
<Version>2.8.0</Version>
<Version>2.8.1</Version>
<AssemblyName>Amazon.Lambda.Core</AssemblyName>
<PackageId>Amazon.Lambda.Core</PackageId>
<PackageTags>AWS;Amazon;Lambda</PackageTags>
Expand All @@ -18,6 +18,9 @@
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>Amazon.Lambda.RuntimeSupport, PublicKey="0024000004800000940000000602000000240000525341310004000001000100db5f59f098d27276c7833875a6263a3cc74ab17ba9a9df0b52aedbe7252745db7274d5271fd79c1f08f668ecfa8eaab5626fa76adc811d3c8fc55859b0d09d3bc0a84eecd0ba891f2b8a2fc55141cdcc37c2053d53491e650a479967c3622762977900eddbf1252ed08a2413f00a28f3a0752a81203f03ccb7f684db373518b4"</_Parameter1>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>Amazon.Lambda.RuntimeSupport.TestTool, PublicKey="0024000004800000940000000602000000240000525341310004000001000100db5f59f098d27276c7833875a6263a3cc74ab17ba9a9df0b52aedbe7252745db7274d5271fd79c1f08f668ecfa8eaab5626fa76adc811d3c8fc55859b0d09d3bc0a84eecd0ba891f2b8a2fc55141cdcc37c2053d53491e650a479967c3622762977900eddbf1252ed08a2413f00a28f3a0752a81203f03ccb7f684db373518b4"</_Parameter1>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>Amazon.Lambda.RuntimeSupport.UnitTests, PublicKey="0024000004800000940000000602000000240000525341310004000001000100db5f59f098d27276c7833875a6263a3cc74ab17ba9a9df0b52aedbe7252745db7274d5271fd79c1f08f668ecfa8eaab5626fa76adc811d3c8fc55859b0d09d3bc0a84eecd0ba891f2b8a2fc55141cdcc37c2053d53491e650a479967c3622762977900eddbf1252ed08a2413f00a28f3a0752a81203f03ccb7f684db373518b4"</_Parameter1>
</AssemblyAttribute>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0;net8.0;net9.0;net10.0</TargetFrameworks>
<Version>1.14.1</Version>
<Version>1.14.2</Version>
<Description>Provides a bootstrap and Lambda Runtime API Client to help you to develop custom .NET Core Lambda Runtimes.</Description>
<AssemblyTitle>Amazon.Lambda.RuntimeSupport</AssemblyTitle>
<AssemblyName>Amazon.Lambda.RuntimeSupport</AssemblyName>
<PackageId>Amazon.Lambda.RuntimeSupport</PackageId>
<PackageTags>AWS;Amazon;Lambda</PackageTags>
<PackageReadmeFile>README.md</PackageReadmeFile>
Expand All @@ -24,6 +23,13 @@
<CheckEolTargetFramework>false</CheckEolTargetFramework>
</PropertyGroup>

<PropertyGroup Condition=" '$(AlternateAssemblyName)'!='' ">
<AssemblyName>$(AlternateAssemblyName)</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(AlternateAssemblyName)'=='' ">
<AssemblyName>Amazon.Lambda.RuntimeSupport</AssemblyName>
</PropertyGroup>

<PropertyGroup Condition=" '$(ExecutableOutputType)'=='true' ">
<OutputType>Exe</OutputType>
<DefineConstants>$(DefineConstants);ExecutableOutputType</DefineConstants>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -441,14 +453,24 @@ 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
// trace id will never work in the future. Avoid triggering exceptions for every invocation.
_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.");
}
}
}
}

Expand Down
7 changes: 4 additions & 3 deletions Tools/LambdaTestTool-v2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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: `<project_name>::<namespace>.<class>::<method_name>`
- Example: `MyLambdaFunction::MyLambdaFunction.Function::Add`
Expand Down Expand Up @@ -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 <absolute-path>` to specify the storage path.
You can use the command line argument `--config-storage-path <absolute-path>` to specify the storage path.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PackAsTool>true</PackAsTool>
<PackageId>Amazon.Lambda.TestTool</PackageId>
<ToolCommandName>dotnet-lambda-test-tool</ToolCommandName>
<Version>0.11.1</Version>
<Version>0.12.0</Version>
<NoWarn>NU5100</NoWarn>
<RollForward>Major</RollForward>
<PackageReadmeFile>README.md</PackageReadmeFile>
Expand Down Expand Up @@ -47,7 +47,7 @@
</Target>

<Target Name="PublishRuntimeSupportFiles" DependsOnTargets="GetRuntimeSupportTargetFrameworks" BeforeTargets="Build">
<Exec Command="dotnet publish &quot;$(MSBuildThisFileDirectory)../../../../Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj&quot; -c $(Configuration) -f %(TargetFrameworks.Identity) /p:ExecutableOutputType=true" />
<Exec Command="dotnet publish &quot;$(MSBuildThisFileDirectory)../../../../Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj&quot; -c $(Configuration) -f %(TargetFrameworks.Identity) /p:ExecutableOutputType=true /p:AlternateAssemblyName=Amazon.Lambda.RuntimeSupport.TestTool" />
</Target>

<Target Name="CopyRuntimeSupportFiles" DependsOnTargets="GetRuntimeSupportTargetFrameworks" BeforeTargets="_GetPackageFiles">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Loading