From 63130d1a120b539793322bb0e8081b7627c36baa Mon Sep 17 00:00:00 2001 From: Phil Asmar Date: Tue, 12 Nov 2024 19:04:40 -0500 Subject: [PATCH 01/25] chore: update .NET 9 Lambda container images to .NET 9 GA --- LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile | 4 ++-- LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile index 1720840be..7b35c22de 100644 --- a/LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile @@ -1,7 +1,7 @@ # Based on Docker image from: https://github.com/dotnet/dotnet-docker/ -ARG ASPNET_VERSION=9.0.0-rc.2.24474.3 -ARG ASPNET_SHA512=9370c26174cd7f1b2fef58e0a53041c94b7d5412f15ea5865fbc653a65b148b1f92e7992f147610a6ca2e92011ff28c43480ab26a6e7f8cd56f2189af0610be8 +ARG ASPNET_VERSION=9.0.0 +ARG ASPNET_SHA512=1a81023f119dd5e5b0f9d87b0e3c42df89824b9fcb73192a4670cc2c67358cd018a7c9c965245c7883de468bda88c81d64a21c60f9bc68a6559d76f32d34ce96 ARG LAMBDA_RUNTIME_NAME=dotnet9 ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023 diff --git a/LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile index 4857566a8..89f7512eb 100644 --- a/LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile @@ -1,7 +1,7 @@ # Based on Docker image from: https://github.com/dotnet/dotnet-docker/ -ARG ASPNET_VERSION=9.0.0-rc.2.24474.3 -ARG ASPNET_SHA512=b6de668ce8714476be78ae00ed66027f3a5b06d95c6768ad6b3eca4d0f396c91843267c0e8c03160b709a7acdcbc2b09047f1ec8d46309d40c3d31f849cc981f +ARG ASPNET_VERSION=9.0.0 +ARG ASPNET_SHA512=d5df4b549a59c8b9b2bcee5e0ffa9fde81fc3df74b299ab49820af6bc0ccfb89eec3714ea558ffcdd2a16821a4d1ecdcc64e9981804978ee3ff1d444b8125681 ARG LAMBDA_RUNTIME_NAME=dotnet9 ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023 From 7a0cb17e2477703cdfb8a41ec6decb3dda994b87 Mon Sep 17 00:00:00 2001 From: Phil Asmar Date: Tue, 12 Nov 2024 19:04:40 -0500 Subject: [PATCH 02/25] chore: update .NET 9 Lambda container images to .NET 9 GA --- LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile | 4 ++-- LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile index 1720840be..7b35c22de 100644 --- a/LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile @@ -1,7 +1,7 @@ # Based on Docker image from: https://github.com/dotnet/dotnet-docker/ -ARG ASPNET_VERSION=9.0.0-rc.2.24474.3 -ARG ASPNET_SHA512=9370c26174cd7f1b2fef58e0a53041c94b7d5412f15ea5865fbc653a65b148b1f92e7992f147610a6ca2e92011ff28c43480ab26a6e7f8cd56f2189af0610be8 +ARG ASPNET_VERSION=9.0.0 +ARG ASPNET_SHA512=1a81023f119dd5e5b0f9d87b0e3c42df89824b9fcb73192a4670cc2c67358cd018a7c9c965245c7883de468bda88c81d64a21c60f9bc68a6559d76f32d34ce96 ARG LAMBDA_RUNTIME_NAME=dotnet9 ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023 diff --git a/LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile index 4857566a8..89f7512eb 100644 --- a/LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile @@ -1,7 +1,7 @@ # Based on Docker image from: https://github.com/dotnet/dotnet-docker/ -ARG ASPNET_VERSION=9.0.0-rc.2.24474.3 -ARG ASPNET_SHA512=b6de668ce8714476be78ae00ed66027f3a5b06d95c6768ad6b3eca4d0f396c91843267c0e8c03160b709a7acdcbc2b09047f1ec8d46309d40c3d31f849cc981f +ARG ASPNET_VERSION=9.0.0 +ARG ASPNET_SHA512=d5df4b549a59c8b9b2bcee5e0ffa9fde81fc3df74b299ab49820af6bc0ccfb89eec3714ea558ffcdd2a16821a4d1ecdcc64e9981804978ee3ff1d444b8125681 ARG LAMBDA_RUNTIME_NAME=dotnet9 ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023 From 2c65c0d2f8f385bcbaebf92d84c93031e96bc8da Mon Sep 17 00:00:00 2001 From: Norm Johanson Date: Thu, 14 Nov 2024 13:37:45 -0800 Subject: [PATCH 03/25] Update Lambda Blueprints (#1871) * Update dependencies for blueprints. * Update Custom Runtime blueprint to target .NET 9 * Version bump blueprint package --- .../BlueprintBaseName.1.csproj | 8 +-- .../BlueprintBaseName.1/serverless.template | 42 +++++++++++-- .../BlueprintBaseName.1.Tests.csproj | 12 ++-- .../BlueprintBaseName.1.fsproj | 2 +- .../BlueprintBaseName.1.Tests.fsproj | 8 +-- .../BlueprintBaseName.1.fsproj | 2 +- .../BlueprintBaseName.1.Tests.fsproj | 10 +-- .../BlueprintBaseName.1.csproj | 2 +- .../BlueprintBaseName.1.Tests.csproj | 10 +-- .../BlueprintBaseName.1.csproj | 2 +- .../BlueprintBaseName.1.csproj | 2 +- .../BlueprintBaseName.1.Tests.csproj | 10 +-- .../BlueprintBaseName.1.csproj | 2 +- .../BlueprintBaseName.1.csproj | 4 +- .../BlueprintBaseName.1.Tests.csproj | 8 +-- .../blueprint-manifest.json | 2 +- .../template/.template.config/template.json | 2 +- .../BlueprintBaseName.1.fsproj | 12 ++-- .../BlueprintBaseName.1.Tests.fsproj | 11 ++-- .../BlueprintBaseName.1.Tests/FunctionTest.fs | 3 - .../test/BlueprintBaseName.1.Tests/Program.fs | 1 + .../blueprint-manifest.json | 2 +- .../template/.template.config/template.json | 2 +- .../BlueprintBaseName.1.csproj | 12 ++-- .../BlueprintBaseName.1.Tests.csproj | 10 +-- .../BlueprintBaseName.1.fsproj | 8 +-- .../BlueprintBaseName.1.Tests.fsproj | 9 +-- .../BlueprintBaseName.1.Tests/FunctionTest.fs | 5 +- .../test/BlueprintBaseName.1.Tests/Program.fs | 1 + .../BlueprintBaseName.1.csproj | 8 +-- .../BlueprintBaseName.1.Tests.csproj | 10 +-- .../BlueprintBaseName.1.fsproj | 8 +-- .../BlueprintBaseName.1.Tests.fsproj | 11 ++-- .../BlueprintBaseName.1.Tests/FunctionTest.fs | 3 - .../test/BlueprintBaseName.1.Tests/Program.fs | 1 + .../BlueprintBaseName.1.csproj | 8 +-- .../BlueprintBaseName.1.Tests.csproj | 10 +-- .../BlueprintBaseName.1.fsproj | 4 +- .../BlueprintBaseName.1.Tests.fsproj | 9 +-- .../BlueprintBaseName.1.Tests/FunctionTest.fs | 3 - .../test/BlueprintBaseName.1.Tests/Program.fs | 1 + .../BlueprintBaseName.1.fsproj | 4 +- .../BlueprintBaseName.1.Tests.fsproj | 8 +-- .../BlueprintBaseName.1.csproj | 4 +- .../BlueprintBaseName.1.Tests.csproj | 8 +-- .../BlueprintBaseName.1.csproj | 4 +- .../BlueprintBaseName.1.Tests.csproj | 8 +-- .../BlueprintBaseName.1.fsproj | 6 +- .../BlueprintBaseName.1.Tests.fsproj | 11 ++-- .../FunctionsTest.fs | 2 - .../test/BlueprintBaseName.1.Tests/Program.fs | 1 + .../BlueprintBaseName.1.fsproj | 6 +- .../BlueprintBaseName.1.Tests.fsproj | 10 +-- .../BlueprintBaseName.1.csproj | 8 +-- .../BlueprintBaseName.1/serverless.template | 10 ++- .../BlueprintBaseName.1.Tests.csproj | 10 +-- .../BlueprintBaseName.1.csproj | 8 +-- .../BlueprintBaseName.1/serverless.template | 10 ++- .../BlueprintBaseName.1.Tests.csproj | 10 +-- .../BlueprintBaseName.1.fsproj | 4 +- .../BlueprintBaseName.1.Tests.fsproj | 11 ++-- .../HttpHandlersTests.fs | 5 +- .../test/BlueprintBaseName.1.Tests/Program.fs | 1 + .../BlueprintBaseName.1.csproj | 4 +- .../BlueprintBaseName.1.Tests.csproj | 8 +-- .../BlueprintBaseName.1.csproj | 6 +- .../BlueprintBaseName.1/serverless.template | 61 ++++++++++++++++++- .../BlueprintBaseName.1.Tests.csproj | 6 +- .../FunctionsTest.cs | 4 +- .../BlueprintBaseName.1.fsproj | 6 +- .../BlueprintBaseName.1.Tests.fsproj | 9 +-- .../BlueprintBaseName.1.Tests/FunctionTest.fs | 5 +- .../test/BlueprintBaseName.1.Tests/Program.fs | 1 + .../BlueprintBaseName.1.csproj | 6 +- .../BlueprintBaseName.1.Tests.csproj | 8 +-- .../BlueprintBaseName.1.fsproj | 8 +-- .../BlueprintBaseName.1.Tests.fsproj | 9 +-- .../BlueprintBaseName.1.Tests/FunctionTest.fs | 2 - .../test/BlueprintBaseName.1.Tests/Program.fs | 1 + .../BlueprintBaseName.1.csproj | 12 ++-- .../BlueprintBaseName.1/serverless.template | 18 +++++- .../BlueprintBaseName.1.Tests.csproj | 8 +-- .../BlueprintBaseName.1.csproj | 12 ++-- .../BlueprintBaseName.1.Tests.csproj | 8 +-- .../BlueprintBaseName.1.csproj | 14 ++--- .../BlueprintBaseName.1.Tests.csproj | 10 +-- .../BlueprintBaseName.1.csproj | 4 +- .../BlueprintBaseName.1.Tests.csproj | 8 +-- .../BlueprintBaseName.1.fsproj | 6 +- .../BlueprintBaseName.1.Tests.fsproj | 11 ++-- .../BlueprintBaseName.1.Tests/FunctionTest.fs | 2 - .../test/BlueprintBaseName.1.Tests/Program.fs | 1 + .../BlueprintBaseName.1.csproj | 6 +- .../BlueprintBaseName.1.Tests.csproj | 10 +-- .../BlueprintBaseName.1.csproj | 4 +- .../BlueprintBaseName.1.Tests.csproj | 8 +-- .../BlueprintBaseName.1.fsproj | 4 +- .../BlueprintBaseName.1.Tests.fsproj | 9 +-- .../BlueprintBaseName.1.Tests/FunctionTest.fs | 5 +- .../test/BlueprintBaseName.1.Tests/Program.fs | 1 + .../BlueprintBaseName.1.csproj | 4 +- .../BlueprintBaseName.1.Tests.csproj | 8 +-- .../BlueprintBaseName.1.fsproj | 6 +- .../BlueprintBaseName.1.Tests.fsproj | 11 ++-- .../BlueprintBaseName.1.Tests/FunctionTest.fs | 5 +- .../test/BlueprintBaseName.1.Tests/Program.fs | 1 + .../BlueprintBaseName.1.csproj | 6 +- .../BlueprintBaseName.1.Tests.csproj | 12 ++-- .../BlueprintBaseName.1.fsproj | 6 +- .../BlueprintBaseName.1.Tests.fsproj | 11 ++-- .../BlueprintBaseName.1.Tests/FunctionTest.fs | 5 +- .../test/BlueprintBaseName.1.Tests/Program.fs | 1 + .../BlueprintBaseName.1.csproj | 6 +- .../BlueprintBaseName.1.Tests.csproj | 10 +-- .../BlueprintBaseName.1.csproj | 4 +- .../BlueprintBaseName.1.Tests.csproj | 8 +-- .../BlueprintBaseName.1.csproj | 4 +- .../BlueprintBaseName.1.Tests.csproj | 8 +-- .../BlueprintBaseName.1.fsproj | 4 +- .../BlueprintBaseName.1.Tests.fsproj | 9 +-- .../BlueprintBaseName.1.Tests/FunctionTest.fs | 5 +- .../test/BlueprintBaseName.1.Tests/Program.fs | 1 + .../BlueprintBaseName.1.csproj | 4 +- .../BlueprintBaseName.1.Tests.csproj | 8 +-- .../vs2022/Templates.csproj | 2 +- .../BlueprintBaseName.1.csproj | 6 +- .../BlueprintBaseName.1.csproj | 10 +-- .../BlueprintBaseName.1.Tests.csproj | 12 ++-- CHANGELOG.md | 7 +++ 129 files changed, 514 insertions(+), 404 deletions(-) create mode 100644 Blueprints/BlueprintDefinitions/vs2022/CustomRuntimeFunction-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs create mode 100644 Blueprints/BlueprintDefinitions/vs2022/DetectImageLabels-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs create mode 100644 Blueprints/BlueprintDefinitions/vs2022/DetectImageLabelsServerless-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs create mode 100644 Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs create mode 100644 Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs create mode 100644 Blueprints/BlueprintDefinitions/vs2022/GiraffeWebApp-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs create mode 100644 Blueprints/BlueprintDefinitions/vs2022/NativeAOTFunction-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs create mode 100644 Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs create mode 100644 Blueprints/BlueprintDefinitions/vs2022/SimpleDynamoDBFunction-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs create mode 100644 Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFunction-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs create mode 100644 Blueprints/BlueprintDefinitions/vs2022/SimpleS3Function-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs create mode 100644 Blueprints/BlueprintDefinitions/vs2022/SimpleS3FunctionServerless-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs create mode 100644 Blueprints/BlueprintDefinitions/vs2022/StepFunctionsHelloWorld-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs diff --git a/Blueprints/BlueprintDefinitions/vs2022/AnnotationsFramework/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/AnnotationsFramework/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj index 58242be97..fbff809d8 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/AnnotationsFramework/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/AnnotationsFramework/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj @@ -12,10 +12,10 @@ true - - - - + + + + @@ -27,13 +27,13 @@ package need to be included to support internationalization. --> - - + + - - - + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/CustomRuntimeFunction-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj b/Blueprints/BlueprintDefinitions/vs2022/CustomRuntimeFunction-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj index 099cad24d..321fad7d2 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/CustomRuntimeFunction-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj +++ b/Blueprints/BlueprintDefinitions/vs2022/CustomRuntimeFunction-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj @@ -2,17 +2,18 @@ Library false - net8.0 + net9.0 + - + - - - + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/CustomRuntimeFunction-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs b/Blueprints/BlueprintDefinitions/vs2022/CustomRuntimeFunction-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs index 47e05ddbd..774b8eb9c 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/CustomRuntimeFunction-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs +++ b/Blueprints/BlueprintDefinitions/vs2022/CustomRuntimeFunction-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs @@ -15,6 +15,3 @@ module FunctionTest = let upperCase = Function.functionHandler "hello world" context Assert.Equal("HELLO WORLD", upperCase) - - [] - let main _ = 0 diff --git a/Blueprints/BlueprintDefinitions/vs2022/CustomRuntimeFunction-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs b/Blueprints/BlueprintDefinitions/vs2022/CustomRuntimeFunction-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs new file mode 100644 index 000000000..0695f84c6 --- /dev/null +++ b/Blueprints/BlueprintDefinitions/vs2022/CustomRuntimeFunction-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs @@ -0,0 +1 @@ +module Program = let [] main _ = 0 diff --git a/Blueprints/BlueprintDefinitions/vs2022/CustomRuntimeFunction/blueprint-manifest.json b/Blueprints/BlueprintDefinitions/vs2022/CustomRuntimeFunction/blueprint-manifest.json index d6377a588..113e74d32 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/CustomRuntimeFunction/blueprint-manifest.json +++ b/Blueprints/BlueprintDefinitions/vs2022/CustomRuntimeFunction/blueprint-manifest.json @@ -1,7 +1,7 @@ { "display-name": "Custom Runtime Function", "system-name": "CustomRuntimeFunction", - "description": "Use Lambda Custom Runtime feature to build Lambda functions using .NET 8.", + "description": "Use Lambda Custom Runtime feature to build Lambda functions using .NET 9.", "sort-order": 125, "hidden-tags": [ "C#", diff --git a/Blueprints/BlueprintDefinitions/vs2022/CustomRuntimeFunction/template/.template.config/template.json b/Blueprints/BlueprintDefinitions/vs2022/CustomRuntimeFunction/template/.template.config/template.json index b609fbfc3..3ae09c2c0 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/CustomRuntimeFunction/template/.template.config/template.json +++ b/Blueprints/BlueprintDefinitions/vs2022/CustomRuntimeFunction/template/.template.config/template.json @@ -5,7 +5,7 @@ "Lambda", "Function" ], - "name": "Lambda Custom Runtime Function (.NET 8)", + "name": "Lambda Custom Runtime Function (.NET 9)", "identity": "AWS.Lambda.Function.CustomRuntimeFunction.CSharp", "groupIdentity": "AWS.Lambda.Function.CustomRuntimFunction", "shortName": "lambda.CustomRuntimeFunction", diff --git a/Blueprints/BlueprintDefinitions/vs2022/CustomRuntimeFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/CustomRuntimeFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj index 75df728cc..8e6166efe 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/CustomRuntimeFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/CustomRuntimeFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj @@ -1,7 +1,7 @@ Exe - net8.0 + net9.0 enable enable Lambda @@ -23,12 +23,12 @@ package need to be included to support internationalization. --> - - + + - - - + + + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/CustomRuntimeFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj b/Blueprints/BlueprintDefinitions/vs2022/CustomRuntimeFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj index 065f45efb..8dde57b0d 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/CustomRuntimeFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/CustomRuntimeFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj @@ -1,16 +1,16 @@ - net8.0 + net9.0 enable enable true - + - - - + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabels-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj b/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabels-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj index a3ffea702..b1a475ba6 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabels-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj +++ b/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabels-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj @@ -9,10 +9,10 @@ true - - - - + + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabels-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj b/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabels-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj index a64b01e5f..4ba485965 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabels-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj +++ b/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabels-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj @@ -10,18 +10,19 @@ - + - + - + - + + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabels-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs b/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabels-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs index 27f2ba41b..9e0dc3f78 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabels-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs +++ b/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabels-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs @@ -61,7 +61,4 @@ module FunctionTest = AmazonS3Util.DeleteS3BucketWithObjectsAsync(s3Client, bucketName) |> Async.AwaitTask |> Async.RunSynchronously - } - - [] - let main _ = 0 + } \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabels-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs b/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabels-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs new file mode 100644 index 000000000..0695f84c6 --- /dev/null +++ b/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabels-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs @@ -0,0 +1 @@ +module Program = let [] main _ = 0 diff --git a/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabels/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabels/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj index 3252bbf26..5e3dd7a4f 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabels/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabels/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj @@ -11,10 +11,10 @@ true - - - - + + + + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabels/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj b/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabels/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj index 0be85cffe..da20f77d4 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabels/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabels/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj @@ -11,13 +11,13 @@ - + - + - - - + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabelsServerless-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj b/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabelsServerless-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj index ff47ef387..5f1fec598 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabelsServerless-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj +++ b/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabelsServerless-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj @@ -9,10 +9,10 @@ true - - - - + + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabelsServerless-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj b/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabelsServerless-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj index 9be0ec67a..708110668 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabelsServerless-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj +++ b/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabelsServerless-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj @@ -10,18 +10,19 @@ - + - + - - - + + + + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabelsServerless-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs b/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabelsServerless-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs index 27f2ba41b..acc85a740 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabelsServerless-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs +++ b/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabelsServerless-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs @@ -62,6 +62,3 @@ module FunctionTest = |> Async.AwaitTask |> Async.RunSynchronously } - - [] - let main _ = 0 diff --git a/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabelsServerless-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs b/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabelsServerless-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs new file mode 100644 index 000000000..0695f84c6 --- /dev/null +++ b/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabelsServerless-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs @@ -0,0 +1 @@ +module Program = let [] main _ = 0 diff --git a/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabelsServerless/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabelsServerless/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj index 3252bbf26..5e3dd7a4f 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabelsServerless/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabelsServerless/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj @@ -11,10 +11,10 @@ true - - - - + + + + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabelsServerless/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj b/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabelsServerless/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj index 0be85cffe..da20f77d4 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabelsServerless/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabelsServerless/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj @@ -11,13 +11,13 @@ - + - + - - - + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj b/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj index 9972cc078..9bc623982 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj +++ b/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj @@ -15,8 +15,8 @@ - - + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj b/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj index 099cad24d..eaff53c12 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj +++ b/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj @@ -6,13 +6,14 @@ + - + - - - + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs b/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs index a6a2d182c..d846bef6b 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs +++ b/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs @@ -16,6 +16,3 @@ module FunctionTest = let upperCase = lambdaFunction.FunctionHandler "hello world" context Assert.Equal("HELLO WORLD", upperCase) - - [] - let main _ = 0 diff --git a/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs b/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs new file mode 100644 index 000000000..0695f84c6 --- /dev/null +++ b/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs @@ -0,0 +1 @@ +module Program = let [] main _ = 0 diff --git a/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-Image-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj b/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-Image-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj index 1497d2fd1..b614aa9b3 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-Image-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj +++ b/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-Image-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj @@ -15,8 +15,8 @@ - - + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-Image-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj b/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-Image-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj index 12e1769a3..92d87f513 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-Image-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj +++ b/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-Image-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj @@ -8,11 +8,11 @@ - + - - - + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-Image/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-Image/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj index 3d15b45fe..4119e5ce0 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-Image/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-Image/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj @@ -11,7 +11,7 @@ true - - + + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-Image/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj b/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-Image/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj index d43710e6a..311225386 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-Image/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-Image/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj @@ -6,11 +6,11 @@ true - + - - - + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj index 3d15b45fe..4119e5ce0 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj @@ -11,7 +11,7 @@ true - - + + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj b/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj index 065f45efb..311225386 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/EmptyFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj @@ -6,11 +6,11 @@ true - + - - - + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj b/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj index 7b7054c03..567aed1e5 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj +++ b/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj @@ -15,9 +15,9 @@ - - - + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj b/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj index 11f0e5ed4..366a6d09d 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj +++ b/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj @@ -6,14 +6,15 @@ + - + - - - - + + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionsTest.fs b/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionsTest.fs index accb6fdf8..97a539c0c 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionsTest.fs +++ b/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionsTest.fs @@ -19,5 +19,3 @@ module FunctionsTest = Assert.Equal(200, response.StatusCode) Assert.Equal("Hello AWS Serverless", response.Body) - [] - let main _ = 0 diff --git a/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs b/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs new file mode 100644 index 000000000..0695f84c6 --- /dev/null +++ b/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs @@ -0,0 +1 @@ +module Program = let [] main _ = 0 diff --git a/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-Image-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj b/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-Image-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj index 7371403f9..20e89076e 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-Image-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj +++ b/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-Image-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj @@ -15,9 +15,9 @@ - - - + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-Image-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj b/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-Image-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj index e39105269..f93751a98 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-Image-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj +++ b/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-Image-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj @@ -8,12 +8,12 @@ - + - - - - + + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-Image/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-Image/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj index 538adebf1..30477399c 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-Image/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-Image/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj @@ -11,10 +11,10 @@ true - - - - + + + + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-Image/template/src/BlueprintBaseName.1/serverless.template b/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-Image/template/src/BlueprintBaseName.1/serverless.template index ad424c004..c20f1e845 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-Image/template/src/BlueprintBaseName.1/serverless.template +++ b/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-Image/template/src/BlueprintBaseName.1/serverless.template @@ -1,7 +1,7 @@ { "AWSTemplateFormatVersion": "2010-09-09", "Transform": "AWS::Serverless-2016-10-31", - "Description": "An AWS Serverless Application. This template is partially managed by Amazon.Lambda.Annotations (v1.2.0.0).", + "Description": "An AWS Serverless Application. This template is partially managed by Amazon.Lambda.Annotations (v1.6.0.0).", "Resources": { "BlueprintBaseName._1FunctionsGetGenerated": { "Type": "AWS::Serverless::Function", @@ -41,7 +41,13 @@ "Tool": "Amazon.Lambda.Annotations", "SyncedEvents": [ "RootGet" - ] + ], + "SyncedEventProperties": { + "RootGet": [ + "Path", + "Method" + ] + } }, "Properties": { "MemorySize": 512, diff --git a/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-Image/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj b/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-Image/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj index 8ad700de7..492c2ab8d 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-Image/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-Image/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj @@ -6,12 +6,12 @@ true - + - - - - + + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj index 538adebf1..30477399c 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj @@ -11,10 +11,10 @@ true - - - - + + + + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless/template/src/BlueprintBaseName.1/serverless.template b/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless/template/src/BlueprintBaseName.1/serverless.template index fd7fad382..613bb2280 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless/template/src/BlueprintBaseName.1/serverless.template +++ b/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless/template/src/BlueprintBaseName.1/serverless.template @@ -1,7 +1,7 @@ { "AWSTemplateFormatVersion": "2010-09-09", "Transform": "AWS::Serverless-2016-10-31", - "Description": "An AWS Serverless Application. This template is partially managed by Amazon.Lambda.Annotations (v1.2.0.0).", + "Description": "An AWS Serverless Application. This template is partially managed by Amazon.Lambda.Annotations (v1.6.0.0).", "Resources": { "BlueprintBaseName._1FunctionsGetGenerated": { "Type": "AWS::Serverless::Function", @@ -41,7 +41,13 @@ "Tool": "Amazon.Lambda.Annotations", "SyncedEvents": [ "RootGet" - ] + ], + "SyncedEventProperties": { + "RootGet": [ + "Path", + "Method" + ] + } }, "Properties": { "Runtime": "dotnet8", diff --git a/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj b/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj index 0f4e524ce..492c2ab8d 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/EmptyServerless/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj @@ -6,12 +6,12 @@ true - + - - - - + + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/GiraffeWebApp-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj b/Blueprints/BlueprintDefinitions/vs2022/GiraffeWebApp-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj index 11d81a949..9a3b2e940 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/GiraffeWebApp-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj +++ b/Blueprints/BlueprintDefinitions/vs2022/GiraffeWebApp-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj @@ -10,8 +10,8 @@ true - - + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/GiraffeWebApp-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj b/Blueprints/BlueprintDefinitions/vs2022/GiraffeWebApp-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj index 3da26fff6..14108b549 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/GiraffeWebApp-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj +++ b/Blueprints/BlueprintDefinitions/vs2022/GiraffeWebApp-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj @@ -7,6 +7,7 @@ + @@ -19,12 +20,12 @@ - + - - - - + + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/GiraffeWebApp-FSharp/template/test/BlueprintBaseName.1.Tests/HttpHandlersTests.fs b/Blueprints/BlueprintDefinitions/vs2022/GiraffeWebApp-FSharp/template/test/BlueprintBaseName.1.Tests/HttpHandlersTests.fs index 488406144..709426fa8 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/GiraffeWebApp-FSharp/template/test/BlueprintBaseName.1.Tests/HttpHandlersTests.fs +++ b/Blueprints/BlueprintDefinitions/vs2022/GiraffeWebApp-FSharp/template/test/BlueprintBaseName.1.Tests/HttpHandlersTests.fs @@ -52,7 +52,4 @@ module HttpHandlersTests = Assert.Equal("value1, value2, value3, value4, value5", response.Body) Assert.True(response.MultiValueHeaders.ContainsKey("Content-Type")) Assert.Contains("text/plain", response.MultiValueHeaders.Item("Content-Type").[0]) - } - - [] - let main _ = 0 + } \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/GiraffeWebApp-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs b/Blueprints/BlueprintDefinitions/vs2022/GiraffeWebApp-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs new file mode 100644 index 000000000..0695f84c6 --- /dev/null +++ b/Blueprints/BlueprintDefinitions/vs2022/GiraffeWebApp-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs @@ -0,0 +1 @@ +module Program = let [] main _ = 0 diff --git a/Blueprints/BlueprintDefinitions/vs2022/LexBookTripSample/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/LexBookTripSample/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj index 7d864e3b4..15cb62c15 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/LexBookTripSample/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/LexBookTripSample/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj @@ -11,8 +11,8 @@ true - + - + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/LexBookTripSample/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj b/Blueprints/BlueprintDefinitions/vs2022/LexBookTripSample/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj index 7ca2a0b33..e2b8c6e48 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/LexBookTripSample/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/LexBookTripSample/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj @@ -23,11 +23,11 @@ - + - - - + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/MessageProcessingFramework/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/MessageProcessingFramework/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj index ed7a16a3e..5aafefc99 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/MessageProcessingFramework/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/MessageProcessingFramework/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj @@ -11,9 +11,9 @@ true - - - + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/MessageProcessingFramework/template/src/BlueprintBaseName.1/serverless.template b/Blueprints/BlueprintDefinitions/vs2022/MessageProcessingFramework/template/src/BlueprintBaseName.1/serverless.template index 3499a8afe..279c7988a 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/MessageProcessingFramework/template/src/BlueprintBaseName.1/serverless.template +++ b/Blueprints/BlueprintDefinitions/vs2022/MessageProcessingFramework/template/src/BlueprintBaseName.1/serverless.template @@ -1,7 +1,7 @@ { "AWSTemplateFormatVersion": "2010-09-09", "Transform": "AWS::Serverless-2016-10-31", - "Description": "AWS Message Processing Framework for .NET Template. This template is partially managed by Amazon.Lambda.Annotations (v1.5.0.0).", + "Description": "AWS Message Processing Framework for .NET Template. This template is partially managed by Amazon.Lambda.Annotations (v1.6.0.0).", "Resources": { "MessageProcessingFrameworkDemoQueue": { "Type": "AWS::SQS::Queue" @@ -71,6 +71,65 @@ } } } + }, + "BlueprintBaseName1FunctionsSenderGenerated": { + "Type": "AWS::Serverless::Function", + "Metadata": { + "Tool": "Amazon.Lambda.Annotations" + }, + "Properties": { + "Runtime": "dotnet8", + "CodeUri": ".", + "MemorySize": 512, + "Timeout": 30, + "Policies": [ + "AmazonSQSFullAccess" + ], + "PackageType": "Zip", + "Handler": "BlueprintBaseName.1::BlueprintBaseName._1.Functions_Sender_Generated::Sender" + } + }, + "BlueprintBaseName1FunctionsHandlerGenerated": { + "Type": "AWS::Serverless::Function", + "Metadata": { + "Tool": "Amazon.Lambda.Annotations", + "SyncedEvents": [ + "SQSEvent" + ], + "SyncedEventProperties": { + "SQSEvent": [ + "Queue.Fn::GetAtt", + "FunctionResponseTypes" + ] + } + }, + "Properties": { + "Runtime": "dotnet8", + "CodeUri": ".", + "MemorySize": 512, + "Timeout": 30, + "Policies": [ + "AWSLambdaSQSQueueExecutionRole" + ], + "PackageType": "Zip", + "Handler": "BlueprintBaseName.1::BlueprintBaseName._1.Functions_Handler_Generated::Handler", + "Events": { + "SQSEvent": { + "Type": "SQS", + "Properties": { + "FunctionResponseTypes": [ + "ReportBatchItemFailures" + ], + "Queue": { + "Fn::GetAtt": [ + "MessageProcessingFrameworkDemoQueue", + "Arn" + ] + } + } + } + } + } } } } \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/MessageProcessingFramework/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj b/Blueprints/BlueprintDefinitions/vs2022/MessageProcessingFramework/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj index 15be44f06..348ac8f49 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/MessageProcessingFramework/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/MessageProcessingFramework/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj @@ -7,9 +7,9 @@ - - - + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/MessageProcessingFramework/template/test/BlueprintBaseName.1.Tests/FunctionsTest.cs b/Blueprints/BlueprintDefinitions/vs2022/MessageProcessingFramework/template/test/BlueprintBaseName.1.Tests/FunctionsTest.cs index 5d05e61e3..543ee9b9c 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/MessageProcessingFramework/template/test/BlueprintBaseName.1.Tests/FunctionsTest.cs +++ b/Blueprints/BlueprintDefinitions/vs2022/MessageProcessingFramework/template/test/BlueprintBaseName.1.Tests/FunctionsTest.cs @@ -11,7 +11,7 @@ public class FunctionsTest /// successfully when handling a valid message /// [Fact] - public async void Handler_ValidMessage_Success() + public async Task Handler_ValidMessage_Success() { var handler = new GreetingMessageHandler(new TestLambdaContext()); @@ -34,7 +34,7 @@ public async void Handler_ValidMessage_Success() /// a failure status when handling an invalid envelope /// [Fact] - public async void Hander_InvalidMesssage_Failed() + public async Task Hander_InvalidMesssage_Failed() { var handler = new GreetingMessageHandler(new TestLambdaContext()); diff --git a/Blueprints/BlueprintDefinitions/vs2022/NativeAOTFunction-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj b/Blueprints/BlueprintDefinitions/vs2022/NativeAOTFunction-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj index ba2be7b85..0e4e9f823 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/NativeAOTFunction-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj +++ b/Blueprints/BlueprintDefinitions/vs2022/NativeAOTFunction-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj @@ -21,9 +21,9 @@ - - - + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/NativeAOTFunction-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj b/Blueprints/BlueprintDefinitions/vs2022/NativeAOTFunction-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj index 099cad24d..d9a229b4c 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/NativeAOTFunction-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj +++ b/Blueprints/BlueprintDefinitions/vs2022/NativeAOTFunction-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj @@ -6,13 +6,14 @@ + - + - - - + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/NativeAOTFunction-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs b/Blueprints/BlueprintDefinitions/vs2022/NativeAOTFunction-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs index 47e05ddbd..9c32b9d3e 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/NativeAOTFunction-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs +++ b/Blueprints/BlueprintDefinitions/vs2022/NativeAOTFunction-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs @@ -14,7 +14,4 @@ module FunctionTest = let context = TestLambdaContext() let upperCase = Function.functionHandler "hello world" context - Assert.Equal("HELLO WORLD", upperCase) - - [] - let main _ = 0 + Assert.Equal("HELLO WORLD", upperCase) \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/NativeAOTFunction-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs b/Blueprints/BlueprintDefinitions/vs2022/NativeAOTFunction-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs new file mode 100644 index 000000000..0695f84c6 --- /dev/null +++ b/Blueprints/BlueprintDefinitions/vs2022/NativeAOTFunction-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs @@ -0,0 +1 @@ +module Program = let [] main _ = 0 diff --git a/Blueprints/BlueprintDefinitions/vs2022/NativeAOTFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/NativeAOTFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj index 717aa47b1..766d6451a 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/NativeAOTFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/NativeAOTFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj @@ -17,8 +17,8 @@ partial - - - + + + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/NativeAOTFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj b/Blueprints/BlueprintDefinitions/vs2022/NativeAOTFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj index 065f45efb..311225386 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/NativeAOTFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/NativeAOTFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj @@ -6,11 +6,11 @@ true - + - - - + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj b/Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj index 5f8de7642..bf99411a1 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj +++ b/Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj @@ -21,10 +21,10 @@ - - - - + + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj b/Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj index 099cad24d..d9a229b4c 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj +++ b/Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj @@ -6,13 +6,14 @@ + - + - - - + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs b/Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs index d2fb33170..a8f61db75 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs +++ b/Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs @@ -18,5 +18,3 @@ module FunctionTest = Assert.Equal(200, response.StatusCode) Assert.Equal("Hello AWS Serverless", response.Body) - [] - let main _ = 0 diff --git a/Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs b/Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs new file mode 100644 index 000000000..0695f84c6 --- /dev/null +++ b/Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs @@ -0,0 +1 @@ +module Program = let [] main _ = 0 diff --git a/Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj index 3503ff027..16b40bf9b 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj @@ -17,11 +17,11 @@ partial - - - - - - + + + + + + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless/template/src/BlueprintBaseName.1/serverless.template b/Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless/template/src/BlueprintBaseName.1/serverless.template index b5f935663..de8e9c8ff 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless/template/src/BlueprintBaseName.1/serverless.template +++ b/Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless/template/src/BlueprintBaseName.1/serverless.template @@ -1,7 +1,7 @@ { "AWSTemplateFormatVersion": "2010-09-09", "Transform": "AWS::Serverless-2016-10-31", - "Description": "An AWS Serverless Application. This template is partially managed by Amazon.Lambda.Annotations (v1.2.0.0).", + "Description": "An AWS Serverless Application. This template is partially managed by Amazon.Lambda.Annotations (v1.6.0.0).", "Resources": { "BlueprintBaseName1FunctionsGetFunctionHandlerGenerated": { "Type": "AWS::Serverless::Function", @@ -9,7 +9,13 @@ "Tool": "Amazon.Lambda.Annotations", "SyncedEvents": [ "RootGet" - ] + ], + "SyncedEventProperties": { + "RootGet": [ + "Path", + "Method" + ] + } }, "Properties": { "Runtime": "dotnet8", @@ -43,7 +49,13 @@ "Tool": "Amazon.Lambda.Annotations", "SyncedEvents": [ "RootPost" - ] + ], + "SyncedEventProperties": { + "RootPost": [ + "Path", + "Method" + ] + } }, "Properties": { "Runtime": "dotnet8", diff --git a/Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj b/Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj index 065f45efb..311225386 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj @@ -6,11 +6,11 @@ true - + - - - + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/PowertoolsFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/PowertoolsFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj index 81c0b3993..55e1760bf 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/PowertoolsFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/PowertoolsFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj @@ -12,10 +12,10 @@ true - - - - - + + + + + - + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/PowertoolsFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj b/Blueprints/BlueprintDefinitions/vs2022/PowertoolsFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj index 065f45efb..311225386 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/PowertoolsFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/PowertoolsFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj @@ -6,11 +6,11 @@ true - + - - - + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/PowertoolsServerless/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/PowertoolsServerless/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj index de639ea76..78834f978 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/PowertoolsServerless/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/PowertoolsServerless/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj @@ -12,11 +12,11 @@ true - - - - - - + + + + + + - + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/PowertoolsServerless/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj b/Blueprints/BlueprintDefinitions/vs2022/PowertoolsServerless/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj index 0f4e524ce..492c2ab8d 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/PowertoolsServerless/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/PowertoolsServerless/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj @@ -6,12 +6,12 @@ true - + - - - - + + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleApplicationLoadBalancer/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/SimpleApplicationLoadBalancer/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj index 6ea6ced96..ee2ec02b3 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/SimpleApplicationLoadBalancer/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleApplicationLoadBalancer/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj @@ -11,8 +11,8 @@ true - - + + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleApplicationLoadBalancer/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj b/Blueprints/BlueprintDefinitions/vs2022/SimpleApplicationLoadBalancer/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj index 065f45efb..311225386 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/SimpleApplicationLoadBalancer/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleApplicationLoadBalancer/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj @@ -6,11 +6,11 @@ true - + - - - + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleDynamoDBFunction-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj b/Blueprints/BlueprintDefinitions/vs2022/SimpleDynamoDBFunction-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj index 8bbeb6704..aee1f367f 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/SimpleDynamoDBFunction-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleDynamoDBFunction-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj @@ -9,9 +9,9 @@ true - - - + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleDynamoDBFunction-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj b/Blueprints/BlueprintDefinitions/vs2022/SimpleDynamoDBFunction-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj index 5374de614..1da2ffdbb 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/SimpleDynamoDBFunction-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleDynamoDBFunction-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj @@ -5,17 +5,18 @@ net8.0 - + - - - - + + + + + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleDynamoDBFunction-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs b/Blueprints/BlueprintDefinitions/vs2022/SimpleDynamoDBFunction-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs index 912a54425..c721ef093 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/SimpleDynamoDBFunction-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleDynamoDBFunction-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs @@ -52,5 +52,3 @@ module FunctionTest = Assert.Contains("Stream processing complete", testLogger.Buffer.ToString()) - [] - let main _ = 0 diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleDynamoDBFunction-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs b/Blueprints/BlueprintDefinitions/vs2022/SimpleDynamoDBFunction-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs new file mode 100644 index 000000000..0695f84c6 --- /dev/null +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleDynamoDBFunction-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs @@ -0,0 +1 @@ +module Program = let [] main _ = 0 diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleDynamoDBFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/SimpleDynamoDBFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj index 311dc67af..b104b323d 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/SimpleDynamoDBFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleDynamoDBFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj @@ -11,8 +11,8 @@ true - - - + + + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleDynamoDBFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj b/Blueprints/BlueprintDefinitions/vs2022/SimpleDynamoDBFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj index 33b6700f6..6be0bc896 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/SimpleDynamoDBFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleDynamoDBFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj @@ -6,12 +6,12 @@ true - + - - - - + + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFirehoseFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFirehoseFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj index 6b920ef99..9a4b2fbe7 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFirehoseFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFirehoseFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj @@ -11,8 +11,8 @@ true - - + + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFirehoseFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj b/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFirehoseFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj index 0e5295122..620e1801f 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFirehoseFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFirehoseFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj @@ -14,12 +14,12 @@ - + - - - + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFunction-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj b/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFunction-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj index 89d59f535..b53d687eb 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFunction-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFunction-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj @@ -9,8 +9,8 @@ true - - + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFunction-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj b/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFunction-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj index 16eddfa1c..61ed2a273 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFunction-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFunction-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj @@ -5,17 +5,18 @@ net8.0 - + - - - + + + + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFunction-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs b/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFunction-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs index 292fb0e15..1601d21e0 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFunction-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFunction-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs @@ -35,7 +35,4 @@ module FunctionTest = lambdaFunction.FunctionHandler kinesisEvent context Assert.Contains("id-foo", testLogger.Buffer.ToString()) - Assert.Contains("Stream processing complete", testLogger.Buffer.ToString()) - - [] - let main _ = 0 + Assert.Contains("Stream processing complete", testLogger.Buffer.ToString()) \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFunction-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs b/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFunction-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs new file mode 100644 index 000000000..0695f84c6 --- /dev/null +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFunction-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs @@ -0,0 +1 @@ +module Program = let [] main _ = 0 diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj index f057c79d0..5478a8aa6 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj @@ -11,8 +11,8 @@ true - - + + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj b/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj index 424ba7fcb..c196731e8 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj @@ -6,12 +6,12 @@ true - + - - - + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleS3Function-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj b/Blueprints/BlueprintDefinitions/vs2022/SimpleS3Function-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj index 9f99a5199..21a9a5434 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/SimpleS3Function-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleS3Function-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj @@ -9,10 +9,10 @@ true - - + + - + diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleS3Function-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj b/Blueprints/BlueprintDefinitions/vs2022/SimpleS3Function-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj index f5da95d86..b4747b515 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/SimpleS3Function-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleS3Function-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj @@ -5,18 +5,19 @@ net8.0 - + - - - - + + + + + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleS3Function-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs b/Blueprints/BlueprintDefinitions/vs2022/SimpleS3Function-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs index f901115d5..21ad7d336 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/SimpleS3Function-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleS3Function-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs @@ -56,7 +56,4 @@ module FunctionTest = finally AmazonS3Util.DeleteS3BucketWithObjectsAsync(s3Client, bucketName) |> Async.AwaitTask |> Async.RunSynchronously - } - - [] - let main _ = 0 \ No newline at end of file + } \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleS3Function-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs b/Blueprints/BlueprintDefinitions/vs2022/SimpleS3Function-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs new file mode 100644 index 000000000..0695f84c6 --- /dev/null +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleS3Function-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs @@ -0,0 +1 @@ +module Program = let [] main _ = 0 diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleS3Function/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/SimpleS3Function/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj index aaf3665eb..798340372 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/SimpleS3Function/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleS3Function/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj @@ -11,9 +11,9 @@ true - - + + - + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleS3Function/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj b/Blueprints/BlueprintDefinitions/vs2022/SimpleS3Function/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj index f28f5e98d..d92d37d54 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/SimpleS3Function/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleS3Function/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj @@ -6,14 +6,14 @@ true - + - - - - - + + + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleS3FunctionServerless-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj b/Blueprints/BlueprintDefinitions/vs2022/SimpleS3FunctionServerless-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj index 44692ac99..7b69bf90c 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/SimpleS3FunctionServerless-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleS3FunctionServerless-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj @@ -9,10 +9,10 @@ true - - + + - + diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleS3FunctionServerless-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj b/Blueprints/BlueprintDefinitions/vs2022/SimpleS3FunctionServerless-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj index f5da95d86..b4747b515 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/SimpleS3FunctionServerless-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleS3FunctionServerless-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj @@ -5,18 +5,19 @@ net8.0 - + - - - - + + + + + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleS3FunctionServerless-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs b/Blueprints/BlueprintDefinitions/vs2022/SimpleS3FunctionServerless-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs index bb62a5385..34007c38f 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/SimpleS3FunctionServerless-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleS3FunctionServerless-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs @@ -55,7 +55,4 @@ module FunctionTest = finally AmazonS3Util.DeleteS3BucketWithObjectsAsync(s3Client, bucketName) |> Async.AwaitTask |> Async.RunSynchronously - } - - [] - let main _ = 0 \ No newline at end of file + } \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleS3FunctionServerless-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs b/Blueprints/BlueprintDefinitions/vs2022/SimpleS3FunctionServerless-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs new file mode 100644 index 000000000..0695f84c6 --- /dev/null +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleS3FunctionServerless-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs @@ -0,0 +1 @@ +module Program = let [] main _ = 0 diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleS3FunctionServerless/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/SimpleS3FunctionServerless/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj index aaf3665eb..798340372 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/SimpleS3FunctionServerless/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleS3FunctionServerless/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj @@ -11,9 +11,9 @@ true - - + + - + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleS3FunctionServerless/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj b/Blueprints/BlueprintDefinitions/vs2022/SimpleS3FunctionServerless/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj index 3e6995f12..b5c002a5f 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/SimpleS3FunctionServerless/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleS3FunctionServerless/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj @@ -6,13 +6,13 @@ true - + - - - - + + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleSNSFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/SimpleSNSFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj index 03783ca3f..1f0540549 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/SimpleSNSFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleSNSFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj @@ -11,8 +11,8 @@ true - - + + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleSNSFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj b/Blueprints/BlueprintDefinitions/vs2022/SimpleSNSFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj index 24ee61975..7f3bf1cc3 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/SimpleSNSFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleSNSFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj @@ -6,12 +6,12 @@ true - + - - - + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleSQSFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/SimpleSQSFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj index 3c9e0eaa0..65608bc23 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/SimpleSQSFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleSQSFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj @@ -11,8 +11,8 @@ true - - + + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/SimpleSQSFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj b/Blueprints/BlueprintDefinitions/vs2022/SimpleSQSFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj index 24ee61975..7f3bf1cc3 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/SimpleSQSFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleSQSFunction/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj @@ -6,12 +6,12 @@ true - + - - - + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/StepFunctionsHelloWorld-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj b/Blueprints/BlueprintDefinitions/vs2022/StepFunctionsHelloWorld-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj index 5dbb3cb11..7c959d6b0 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/StepFunctionsHelloWorld-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj +++ b/Blueprints/BlueprintDefinitions/vs2022/StepFunctionsHelloWorld-FSharp/template/src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj @@ -9,8 +9,8 @@ true - - + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/StepFunctionsHelloWorld-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj b/Blueprints/BlueprintDefinitions/vs2022/StepFunctionsHelloWorld-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj index 50faa435e..9987fd6fe 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/StepFunctionsHelloWorld-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj +++ b/Blueprints/BlueprintDefinitions/vs2022/StepFunctionsHelloWorld-FSharp/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.fsproj @@ -5,16 +5,17 @@ net8.0 - + - - - + + + + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/StepFunctionsHelloWorld-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs b/Blueprints/BlueprintDefinitions/vs2022/StepFunctionsHelloWorld-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs index abff2f105..1ca680713 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/StepFunctionsHelloWorld-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs +++ b/Blueprints/BlueprintDefinitions/vs2022/StepFunctionsHelloWorld-FSharp/template/test/BlueprintBaseName.1.Tests/FunctionTest.fs @@ -17,7 +17,4 @@ module FunctionTest = context Assert.Equal(5, state.WaitInSeconds) - Assert.Equal("Hello MyStepFunctions", state.Message) - - [] - let main _ = 0 + Assert.Equal("Hello MyStepFunctions", state.Message) \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/StepFunctionsHelloWorld-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs b/Blueprints/BlueprintDefinitions/vs2022/StepFunctionsHelloWorld-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs new file mode 100644 index 000000000..0695f84c6 --- /dev/null +++ b/Blueprints/BlueprintDefinitions/vs2022/StepFunctionsHelloWorld-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs @@ -0,0 +1 @@ +module Program = let [] main _ = 0 diff --git a/Blueprints/BlueprintDefinitions/vs2022/StepFunctionsHelloWorld/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/StepFunctionsHelloWorld/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj index 3d15b45fe..4119e5ce0 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/StepFunctionsHelloWorld/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/StepFunctionsHelloWorld/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj @@ -11,7 +11,7 @@ true - - + + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/StepFunctionsHelloWorld/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj b/Blueprints/BlueprintDefinitions/vs2022/StepFunctionsHelloWorld/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj index 065f45efb..311225386 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/StepFunctionsHelloWorld/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/StepFunctionsHelloWorld/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj @@ -6,11 +6,11 @@ true - + - - - + + + diff --git a/Blueprints/BlueprintDefinitions/vs2022/Templates.csproj b/Blueprints/BlueprintDefinitions/vs2022/Templates.csproj index 133818c26..0b6f37b2c 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/Templates.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/Templates.csproj @@ -2,7 +2,7 @@ Template - 7.2.1 + 7.3.0 Amazon.Lambda.Templates AWS Lambda Templates Amazon Web Services diff --git a/Blueprints/BlueprintDefinitions/vs2022/TopLevelStatementsFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/TopLevelStatementsFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj index 98c85cc36..081886bf6 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/TopLevelStatementsFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/TopLevelStatementsFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj @@ -12,8 +12,8 @@ true - - - + + + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/WebSocketAPIServerless/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/WebSocketAPIServerless/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj index b594f8c9f..d235d391f 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/WebSocketAPIServerless/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/WebSocketAPIServerless/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj @@ -11,10 +11,10 @@ true - - - - - + + + + + \ No newline at end of file diff --git a/Blueprints/BlueprintDefinitions/vs2022/WebSocketAPIServerless/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj b/Blueprints/BlueprintDefinitions/vs2022/WebSocketAPIServerless/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj index 73522be2f..b0bc2475f 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/WebSocketAPIServerless/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/WebSocketAPIServerless/template/test/BlueprintBaseName.1.Tests/BlueprintBaseName.1.Tests.csproj @@ -6,13 +6,13 @@ true - + - - - - - + + + + + diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c2b5b8db..9cb2938a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## Release 2024-11-13 + +### Amazon.Lambda.Templates (7.3.0) +* Update package Dependencies. +* Custom Runtime templates target .NET 9. +* Rework the `EntryPoint` for F# test projects. + ## Release 2024-11-12 ### Amazon.Lambda.Annotations (1.6.0) From 45432d1d820463114c3916c7dab63a60b60f5330 Mon Sep 17 00:00:00 2001 From: Norm Johanson Date: Thu, 14 Nov 2024 15:58:58 -0800 Subject: [PATCH 04/25] Update Lambda Test Tool to support version 2.4.0 of Amazon.Lambda.Core (#1872) --- .../a6ea8820-2eb2-4ce7-ba06-a1141e740a9b.json | 11 +++++++ .../Amazon.Lambda.TestTool.csproj | 2 +- .../Runtime/LambdaMocks/LocalLambdaLogger.cs | 31 +++++++++++++++++-- .../ConsoleCaptureTests.cs | 17 ++++++++++ 4 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 .autover/changes/a6ea8820-2eb2-4ce7-ba06-a1141e740a9b.json diff --git a/.autover/changes/a6ea8820-2eb2-4ce7-ba06-a1141e740a9b.json b/.autover/changes/a6ea8820-2eb2-4ce7-ba06-a1141e740a9b.json new file mode 100644 index 000000000..cdfbadb71 --- /dev/null +++ b/.autover/changes/a6ea8820-2eb2-4ce7-ba06-a1141e740a9b.json @@ -0,0 +1,11 @@ +{ + "Projects": [ + { + "Name": "Amazon.Lambda.TestTool.BlazorTester", + "Type": "Patch", + "ChangelogMessages": [ + "Fixed issue supporting parameterized logging APIs added to Amazon.Lambda.Core in version 2.4.0" + ] + } + ] +} \ No newline at end of file diff --git a/Tools/LambdaTestTool/src/Amazon.Lambda.TestTool/Amazon.Lambda.TestTool.csproj b/Tools/LambdaTestTool/src/Amazon.Lambda.TestTool/Amazon.Lambda.TestTool.csproj index 9c44cdf94..9cab5238c 100644 --- a/Tools/LambdaTestTool/src/Amazon.Lambda.TestTool/Amazon.Lambda.TestTool.csproj +++ b/Tools/LambdaTestTool/src/Amazon.Lambda.TestTool/Amazon.Lambda.TestTool.csproj @@ -9,7 +9,7 @@ - + diff --git a/Tools/LambdaTestTool/src/Amazon.Lambda.TestTool/Runtime/LambdaMocks/LocalLambdaLogger.cs b/Tools/LambdaTestTool/src/Amazon.Lambda.TestTool/Runtime/LambdaMocks/LocalLambdaLogger.cs index 081dcf3da..3036b3518 100644 --- a/Tools/LambdaTestTool/src/Amazon.Lambda.TestTool/Runtime/LambdaMocks/LocalLambdaLogger.cs +++ b/Tools/LambdaTestTool/src/Amazon.Lambda.TestTool/Runtime/LambdaMocks/LocalLambdaLogger.cs @@ -1,4 +1,5 @@ -using System.Text; +using System; +using System.Text; using Amazon.Lambda.Core; namespace Amazon.Lambda.TestTool.Runtime.LambdaMocks @@ -6,7 +7,33 @@ namespace Amazon.Lambda.TestTool.Runtime.LambdaMocks public class LocalLambdaLogger : ILambdaLogger { private StringBuilder _buffer = new StringBuilder(); - + + public void Log(string level, string message) + { + _buffer.AppendLine($"Level = {level}, Message = {message}"); + } + + public void Log(string level, string message, params object[] args) + { + _buffer.Append($"Level = {level}, Message = {message}"); + if (args?.Length > 0) + _buffer.AppendLine($", Arguments = {string.Join(',', args)}"); + else + _buffer.AppendLine(); + } + + public void Log(string level, Exception exception, string message, params object[] args) + { + + _buffer.Append($"Level = {level}, Message = {message}"); + if (args?.Length > 0) + _buffer.AppendLine($", Arguments = {string.Join(',', args)}"); + else + _buffer.AppendLine(); + + _buffer.AppendLine(exception.ToString()); + } + public void Log(string message) { _buffer.Append(message); diff --git a/Tools/LambdaTestTool/tests/Amazon.Lambda.TestTool.Tests/ConsoleCaptureTests.cs b/Tools/LambdaTestTool/tests/Amazon.Lambda.TestTool.Tests/ConsoleCaptureTests.cs index 5399684d7..b514e265b 100644 --- a/Tools/LambdaTestTool/tests/Amazon.Lambda.TestTool.Tests/ConsoleCaptureTests.cs +++ b/Tools/LambdaTestTool/tests/Amazon.Lambda.TestTool.Tests/ConsoleCaptureTests.cs @@ -37,5 +37,22 @@ public void CaptureStandardError() Assert.DoesNotContain("NOT_CAPTURED", logger.Buffer); } + + [Fact] + public void CallParameterizedLoggingMethods() + { + var logger = new LocalLambdaLogger(); + + logger.Log("INFO", "TheMessage"); + logger.Log("WARN", "TheMessage {argument}", "TheArgument"); + logger.Log("ERROR", new ApplicationException("TheApplicationException"), "TheMessageWithException"); + logger.Log("ERROR", new ApplicationException("TheApplicationException"), "TheMessageWithException {argument}", "TheExceptionArgument"); + + Assert.Contains("Level = INFO, Message = TheMessage", logger.Buffer); + Assert.Contains("Level = WARN, Message = TheMessage {argument}, Arguments = TheArgument", logger.Buffer); + Assert.Contains("Level = ERROR, Message = TheMessageWithException", logger.Buffer); + Assert.Contains("System.ApplicationException: TheApplicationException", logger.Buffer); + Assert.Contains("Level = ERROR, Message = TheMessageWithException {argument}, Arguments = TheExceptionArgument", logger.Buffer); + } } } \ No newline at end of file From 34f39fde0eafb80eeb9c95f9eea17ca49f764c3b Mon Sep 17 00:00:00 2001 From: aws-sdk-dotnet-automation <43080735+aws-sdk-dotnet-automation@users.noreply.github.com> Date: Thu, 14 Nov 2024 16:13:39 -0800 Subject: [PATCH 05/25] Release 2024-11-14 (#1873) --- .../changes/5f868ca3-fd40-4adc-8f0b-3b492276cc77.json | 11 ----------- .../changes/a6ea8820-2eb2-4ce7-ba06-a1141e740a9b.json | 11 ----------- CHANGELOG.md | 6 ++++++ .../TestExecutableServerlessApp/serverless.template | 2 +- .../test/TestServerlessApp.NET8/serverless.template | 2 +- Libraries/test/TestServerlessApp/serverless.template | 2 +- .../Amazon.Lambda.TestTool.BlazorTester.csproj | 2 +- .../Amazon.Lambda.TestTool.BlazorTester60-pack.csproj | 2 +- .../Amazon.Lambda.TestTool.BlazorTester80-pack.csproj | 2 +- .../Amazon.Lambda.TestTool.BlazorTester90-pack.csproj | 2 +- 10 files changed, 13 insertions(+), 29 deletions(-) delete mode 100644 .autover/changes/5f868ca3-fd40-4adc-8f0b-3b492276cc77.json delete mode 100644 .autover/changes/a6ea8820-2eb2-4ce7-ba06-a1141e740a9b.json diff --git a/.autover/changes/5f868ca3-fd40-4adc-8f0b-3b492276cc77.json b/.autover/changes/5f868ca3-fd40-4adc-8f0b-3b492276cc77.json deleted file mode 100644 index 516f112fc..000000000 --- a/.autover/changes/5f868ca3-fd40-4adc-8f0b-3b492276cc77.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "Projects": [ - { - "Name": "Amazon.Lambda.TestTool.BlazorTester", - "Type": "Minor", - "ChangelogMessages": [ - "Update Lambda Test Tool to add a .NET9 target" - ] - } - ] -} \ No newline at end of file diff --git a/.autover/changes/a6ea8820-2eb2-4ce7-ba06-a1141e740a9b.json b/.autover/changes/a6ea8820-2eb2-4ce7-ba06-a1141e740a9b.json deleted file mode 100644 index cdfbadb71..000000000 --- a/.autover/changes/a6ea8820-2eb2-4ce7-ba06-a1141e740a9b.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "Projects": [ - { - "Name": "Amazon.Lambda.TestTool.BlazorTester", - "Type": "Patch", - "ChangelogMessages": [ - "Fixed issue supporting parameterized logging APIs added to Amazon.Lambda.Core in version 2.4.0" - ] - } - ] -} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 9cb2938a9..b37790cd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## Release 2024-11-14 + +### Amazon.Lambda.TestTool.BlazorTester (0.16.0) +* Update Lambda Test Tool to add a .NET9 target +* Fixed issue supporting parameterized logging APIs added to Amazon.Lambda.Core in version 2.4.0 + ## Release 2024-11-13 ### Amazon.Lambda.Templates (7.3.0) diff --git a/Libraries/test/TestExecutableServerlessApp/serverless.template b/Libraries/test/TestExecutableServerlessApp/serverless.template index f48da3f1b..e816a4237 100644 --- a/Libraries/test/TestExecutableServerlessApp/serverless.template +++ b/Libraries/test/TestExecutableServerlessApp/serverless.template @@ -1,7 +1,7 @@ { "AWSTemplateFormatVersion": "2010-09-09", "Transform": "AWS::Serverless-2016-10-31", - "Description": "An AWS Serverless Application. This template is partially managed by Amazon.Lambda.Annotations (v1.5.3.0).", + "Description": "An AWS Serverless Application. This template is partially managed by Amazon.Lambda.Annotations (v1.6.0.0).", "Parameters": { "ArchitectureTypeParameter": { "Type": "String", diff --git a/Libraries/test/TestServerlessApp.NET8/serverless.template b/Libraries/test/TestServerlessApp.NET8/serverless.template index a1a5a1503..a7ef4fbfe 100644 --- a/Libraries/test/TestServerlessApp.NET8/serverless.template +++ b/Libraries/test/TestServerlessApp.NET8/serverless.template @@ -1,7 +1,7 @@ { "AWSTemplateFormatVersion": "2010-09-09", "Transform": "AWS::Serverless-2016-10-31", - "Description": "This template is partially managed by Amazon.Lambda.Annotations (v1.5.3.0).", + "Description": "This template is partially managed by Amazon.Lambda.Annotations (v1.6.0.0).", "Resources": { "TestServerlessAppNET8FunctionsToUpperGenerated": { "Type": "AWS::Serverless::Function", diff --git a/Libraries/test/TestServerlessApp/serverless.template b/Libraries/test/TestServerlessApp/serverless.template index 907b5cd42..32102ed2b 100644 --- a/Libraries/test/TestServerlessApp/serverless.template +++ b/Libraries/test/TestServerlessApp/serverless.template @@ -1,7 +1,7 @@ { "AWSTemplateFormatVersion": "2010-09-09", "Transform": "AWS::Serverless-2016-10-31", - "Description": "An AWS Serverless Application. This template is partially managed by Amazon.Lambda.Annotations (v1.5.3.0).", + "Description": "An AWS Serverless Application. This template is partially managed by Amazon.Lambda.Annotations (v1.6.0.0).", "Parameters": { "ArchitectureTypeParameter": { "Type": "String", diff --git a/Tools/LambdaTestTool/src/Amazon.Lambda.TestTool.BlazorTester/Amazon.Lambda.TestTool.BlazorTester.csproj b/Tools/LambdaTestTool/src/Amazon.Lambda.TestTool.BlazorTester/Amazon.Lambda.TestTool.BlazorTester.csproj index e38f23cad..5336cf982 100644 --- a/Tools/LambdaTestTool/src/Amazon.Lambda.TestTool.BlazorTester/Amazon.Lambda.TestTool.BlazorTester.csproj +++ b/Tools/LambdaTestTool/src/Amazon.Lambda.TestTool.BlazorTester/Amazon.Lambda.TestTool.BlazorTester.csproj @@ -6,7 +6,7 @@ Exe A tool to help debug and test your .NET Core AWS Lambda functions locally. Latest - 0.15.3 + 0.16.0 AWS .NET Lambda Test Tool Apache 2 AWS;Amazon;Lambda diff --git a/Tools/LambdaTestTool/src/Amazon.Lambda.TestTool.BlazorTester/Amazon.Lambda.TestTool.BlazorTester60-pack.csproj b/Tools/LambdaTestTool/src/Amazon.Lambda.TestTool.BlazorTester/Amazon.Lambda.TestTool.BlazorTester60-pack.csproj index ae6ea6373..b560d7c6a 100644 --- a/Tools/LambdaTestTool/src/Amazon.Lambda.TestTool.BlazorTester/Amazon.Lambda.TestTool.BlazorTester60-pack.csproj +++ b/Tools/LambdaTestTool/src/Amazon.Lambda.TestTool.BlazorTester/Amazon.Lambda.TestTool.BlazorTester60-pack.csproj @@ -5,7 +5,7 @@ Exe A tool to help debug and test your .NET 6.0 AWS Lambda functions locally. - 0.15.3 + 0.16.0 AWS .NET Lambda Test Tool Apache 2 AWS;Amazon;Lambda diff --git a/Tools/LambdaTestTool/src/Amazon.Lambda.TestTool.BlazorTester/Amazon.Lambda.TestTool.BlazorTester80-pack.csproj b/Tools/LambdaTestTool/src/Amazon.Lambda.TestTool.BlazorTester/Amazon.Lambda.TestTool.BlazorTester80-pack.csproj index b2945f3df..0159b3ee5 100644 --- a/Tools/LambdaTestTool/src/Amazon.Lambda.TestTool.BlazorTester/Amazon.Lambda.TestTool.BlazorTester80-pack.csproj +++ b/Tools/LambdaTestTool/src/Amazon.Lambda.TestTool.BlazorTester/Amazon.Lambda.TestTool.BlazorTester80-pack.csproj @@ -5,7 +5,7 @@ Exe A tool to help debug and test your .NET 8.0 AWS Lambda functions locally. - 0.15.3 + 0.16.0 AWS .NET Lambda Test Tool Apache 2 AWS;Amazon;Lambda diff --git a/Tools/LambdaTestTool/src/Amazon.Lambda.TestTool.BlazorTester/Amazon.Lambda.TestTool.BlazorTester90-pack.csproj b/Tools/LambdaTestTool/src/Amazon.Lambda.TestTool.BlazorTester/Amazon.Lambda.TestTool.BlazorTester90-pack.csproj index 20b13320f..81ab877c1 100644 --- a/Tools/LambdaTestTool/src/Amazon.Lambda.TestTool.BlazorTester/Amazon.Lambda.TestTool.BlazorTester90-pack.csproj +++ b/Tools/LambdaTestTool/src/Amazon.Lambda.TestTool.BlazorTester/Amazon.Lambda.TestTool.BlazorTester90-pack.csproj @@ -5,7 +5,7 @@ Exe A tool to help debug and test your .NET 9.0 AWS Lambda functions locally. - 0.15.3 + 0.16.0 AWS .NET Lambda Test Tool Apache 2 AWS;Amazon;Lambda From 943862ff5c96e2508f4278c1f869379202fec9a9 Mon Sep 17 00:00:00 2001 From: Norm Johanson Date: Fri, 15 Nov 2024 15:56:50 -0800 Subject: [PATCH 06/25] Add SnapStart support to Amazon.Lambda.Core and Amazon.Lambda.RuntimeSupport The SnapStart support includes adding a new SnapStart.Registry package for registering and invoking hooks during the SnapStart lifecycle. --------- Co-authored-by: Phil Asmar Co-authored-by: Philippe El Asmar <53088140+philasmar@users.noreply.github.com> Co-authored-by: Saksham Bhalla Co-authored-by: Saksham Bhalla Co-authored-by: Philip Pittle --- .gitignore | 1 + CHANGELOG.md | 11 +++ .../Images/net8/amd64/Dockerfile | 1 + .../Images/net8/arm64/Dockerfile | 1 + Libraries/Amazon.Lambda.RuntimeSupport.slnf | 2 + Libraries/Libraries.sln | 14 +++ .../Amazon.Lambda.Core.csproj | 10 +- .../src/Amazon.Lambda.Core/SnapshotRestore.cs | 59 ++++++++++++ .../Amazon.Lambda.RuntimeSupport.csproj | 5 +- .../Bootstrap/Constants.cs | 5 + .../Bootstrap/LambdaBootstrap.cs | 63 ++++++++++-- .../Client/IRuntimeApiClient.cs | 22 ++++- .../Client/InternalClientAdapted.cs | 84 +++++++++++----- .../Client/RuntimeApiClient.cs | 36 ++++++- .../Context/LambdaBootstrapConfiguration.cs | 35 +++++++ ...tartHelperCopySnapshotCallbacksIsolated.cs | 21 ++++ ...perInitializeWithSnapstartIsolatedAsync.cs | 54 +++++++++++ .../Amazon.Lambda.RuntimeSupport/Program.cs | 22 ++++- .../src/SnapshotRestore.Registry/README.md | 39 ++++++++ .../RestoreHooksRegistry.cs | 77 +++++++++++++++ .../SnapshotRestore.Registry.csproj | 25 +++++ .../Helpers/LambdaToolsHelper.cs | 3 + .../IntegrationTestFixture.cs | 1 + ...zon.Lambda.RuntimeSupport.UnitTests.csproj | 5 +- .../LambdaBootstrapTests.cs | 5 +- .../SnapstartTests.cs | 80 ++++++++++++++++ .../TestHelpers/TestRuntimeApiClient.cs | 19 +++- .../RestoreHooksRegistryTests.cs | 90 ++++++++++++++++++ .../SnapshotRestore.Registry.Tests.csproj | 19 ++++ buildtools/build.proj | 1 + buildtools/snapshotrestore.snk | Bin 0 -> 596 bytes 31 files changed, 766 insertions(+), 44 deletions(-) create mode 100644 Libraries/src/Amazon.Lambda.Core/SnapshotRestore.cs create mode 100644 Libraries/src/Amazon.Lambda.RuntimeSupport/Context/LambdaBootstrapConfiguration.cs create mode 100644 Libraries/src/Amazon.Lambda.RuntimeSupport/Helpers/SnapstartHelperCopySnapshotCallbacksIsolated.cs create mode 100644 Libraries/src/Amazon.Lambda.RuntimeSupport/Helpers/SnapstartHelperInitializeWithSnapstartIsolatedAsync.cs create mode 100644 Libraries/src/SnapshotRestore.Registry/README.md create mode 100644 Libraries/src/SnapshotRestore.Registry/RestoreHooksRegistry.cs create mode 100644 Libraries/src/SnapshotRestore.Registry/SnapshotRestore.Registry.csproj create mode 100644 Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.UnitTests/SnapstartTests.cs create mode 100644 Libraries/test/SnapshotRestore.Registry.Tests/RestoreHooksRegistryTests.cs create mode 100644 Libraries/test/SnapshotRestore.Registry.Tests/SnapshotRestore.Registry.Tests.csproj create mode 100644 buildtools/snapshotrestore.snk diff --git a/.gitignore b/.gitignore index 31dc52b60..f91715274 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ **/packages **/launchSettings.json **/Debug/ +**/build/ **/project.lock.json diff --git a/CHANGELOG.md b/CHANGELOG.md index b37790cd9..c1145ebd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +## Release 2024-11-18 + +### Amazon.Lambda.Core (2.5.0) +* Added the new `SnapshotRestore` static class for registering SnapStart hooks for before snapshot and after restore. + +### Amazon.Lambda.RuntimeSupport (1.12.0) +* Added support for handling Lambda SnapStart events. + +### SnapshotRestore.Registry (1.0.0) +* New package used by Amazon.Lambda.RuntimeSupport for registering and executing SnapStart hooks. + ## Release 2024-11-14 ### Amazon.Lambda.TestTool.BlazorTester (0.16.0) diff --git a/LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile index 3ccc3b915..9c498135b 100644 --- a/LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile @@ -31,6 +31,7 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim AS builder WORKDIR /src COPY ["Libraries/src/Amazon.Lambda.RuntimeSupport", "Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/"] COPY ["Libraries/src/Amazon.Lambda.Core", "Repo/Libraries/src/Amazon.Lambda.Core/"] +COPY ["Libraries/src/SnapshotRestore.Registry", "Repo/Libraries/src/SnapshotRestore.Registry/"] COPY ["buildtools/", "Repo/buildtools/"] RUN dotnet restore "Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj" /p:TargetFrameworks=net8.0 WORKDIR "Repo/Libraries/src/Amazon.Lambda.RuntimeSupport" diff --git a/LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile index 604cc489b..60c2309f8 100644 --- a/LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile @@ -31,6 +31,7 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim AS builder WORKDIR /src COPY ["Libraries/src/Amazon.Lambda.RuntimeSupport", "Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/"] COPY ["Libraries/src/Amazon.Lambda.Core", "Repo/Libraries/src/Amazon.Lambda.Core/"] +COPY ["Libraries/src/SnapshotRestore.Registry", "Repo/Libraries/src/SnapshotRestore.Registry/"] COPY ["buildtools/", "Repo/buildtools/"] RUN dotnet restore "Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj" /p:TargetFrameworks=net8.0 WORKDIR "Repo/Libraries/src/Amazon.Lambda.RuntimeSupport" diff --git a/Libraries/Amazon.Lambda.RuntimeSupport.slnf b/Libraries/Amazon.Lambda.RuntimeSupport.slnf index 1f1b383ce..fb03ebc05 100644 --- a/Libraries/Amazon.Lambda.RuntimeSupport.slnf +++ b/Libraries/Amazon.Lambda.RuntimeSupport.slnf @@ -11,11 +11,13 @@ "src\\Amazon.Lambda.RuntimeSupport\\Amazon.Lambda.RuntimeSupport.csproj", "src\\Amazon.Lambda.Serialization.Json\\Amazon.Lambda.Serialization.Json.csproj", "src\\Amazon.Lambda.Serialization.SystemTextJson\\Amazon.Lambda.Serialization.SystemTextJson.csproj", + "src\\SnapshotRestore.Registry\\SnapshotRestore.Registry.csproj", "test\\Amazon.Lambda.RuntimeSupport.Tests\\Amazon.Lambda.RuntimeSupport.IntegrationTests\\Amazon.Lambda.RuntimeSupport.IntegrationTests.csproj", "test\\Amazon.Lambda.RuntimeSupport.Tests\\Amazon.Lambda.RuntimeSupport.UnitTests\\Amazon.Lambda.RuntimeSupport.UnitTests.csproj", "test\\Amazon.Lambda.RuntimeSupport.Tests\\CustomRuntimeAspNetCoreMinimalApiCustomSerializerTest\\CustomRuntimeAspNetCoreMinimalApiCustomSerializerTest.csproj", "test\\Amazon.Lambda.RuntimeSupport.Tests\\CustomRuntimeAspNetCoreMinimalApiTest\\CustomRuntimeAspNetCoreMinimalApiTest.csproj", "test\\Amazon.Lambda.RuntimeSupport.Tests\\CustomRuntimeFunctionTest\\CustomRuntimeFunctionTest.csproj", + "test\\SnapshotRestore.Registry.Tests\\SnapshotRestore.Registry.Tests.csproj", "test\\HandlerTestNoSerializer\\HandlerTestNoSerializer.csproj", "test\\HandlerTest\\HandlerTest.csproj" ] diff --git a/Libraries/Libraries.sln b/Libraries/Libraries.sln index 4f0e88170..3df1056d9 100644 --- a/Libraries/Libraries.sln +++ b/Libraries/Libraries.sln @@ -131,6 +131,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestExecutableServerlessApp EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestServerlessApp.NET8", "test\TestServerlessApp.NET8\TestServerlessApp.NET8.csproj", "{7300983D-8FCE-42EA-9B9E-B1C5347D15D8}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SnapshotRestore.Registry", "src\SnapshotRestore.Registry\SnapshotRestore.Registry.csproj", "{7261A438-8C1D-47AD-98B0-7678F72E4382}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SnapshotRestore.Registry.Tests", "test\SnapshotRestore.Registry.Tests\SnapshotRestore.Registry.Tests.csproj", "{A699E183-D0D4-4F26-A0A7-88DA5607F455}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -357,6 +361,14 @@ Global {7300983D-8FCE-42EA-9B9E-B1C5347D15D8}.Debug|Any CPU.Build.0 = Debug|Any CPU {7300983D-8FCE-42EA-9B9E-B1C5347D15D8}.Release|Any CPU.ActiveCfg = Release|Any CPU {7300983D-8FCE-42EA-9B9E-B1C5347D15D8}.Release|Any CPU.Build.0 = Release|Any CPU + {7261A438-8C1D-47AD-98B0-7678F72E4382}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7261A438-8C1D-47AD-98B0-7678F72E4382}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7261A438-8C1D-47AD-98B0-7678F72E4382}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7261A438-8C1D-47AD-98B0-7678F72E4382}.Release|Any CPU.Build.0 = Release|Any CPU + {A699E183-D0D4-4F26-A0A7-88DA5607F455}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A699E183-D0D4-4F26-A0A7-88DA5607F455}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A699E183-D0D4-4F26-A0A7-88DA5607F455}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A699E183-D0D4-4F26-A0A7-88DA5607F455}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -421,6 +433,8 @@ Global {0BD83939-458C-4EF5-8663-7098AD1200F2} = {B5BD0336-7D08-492C-8489-42C987E29B39} {DD378063-C54A-44C7-9A6F-32A6A1AE94B3} = {1DE4EE60-45BA-4EF7-BE00-B9EB861E4C69} {7300983D-8FCE-42EA-9B9E-B1C5347D15D8} = {1DE4EE60-45BA-4EF7-BE00-B9EB861E4C69} + {7261A438-8C1D-47AD-98B0-7678F72E4382} = {AAB54E74-20B1-42ED-BC3D-CE9F7BC7FD12} + {A699E183-D0D4-4F26-A0A7-88DA5607F455} = {1DE4EE60-45BA-4EF7-BE00-B9EB861E4C69} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {503678A4-B8D1-4486-8915-405A3E9CF0EB} diff --git a/Libraries/src/Amazon.Lambda.Core/Amazon.Lambda.Core.csproj b/Libraries/src/Amazon.Lambda.Core/Amazon.Lambda.Core.csproj index 429bfb07f..c6a034fe0 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.4.0 + 2.5.0 Amazon.Lambda.Core Amazon.Lambda.Core AWS;Amazon;Lambda @@ -15,7 +15,13 @@ - + + <_Parameter1>Amazon.Lambda.RuntimeSupport, PublicKey="0024000004800000940000000602000000240000525341310004000001000100db5f59f098d27276c7833875a6263a3cc74ab17ba9a9df0b52aedbe7252745db7274d5271fd79c1f08f668ecfa8eaab5626fa76adc811d3c8fc55859b0d09d3bc0a84eecd0ba891f2b8a2fc55141cdcc37c2053d53491e650a479967c3622762977900eddbf1252ed08a2413f00a28f3a0752a81203f03ccb7f684db373518b4" + + + <_Parameter1>Amazon.Lambda.RuntimeSupport.UnitTests, PublicKey="0024000004800000940000000602000000240000525341310004000001000100db5f59f098d27276c7833875a6263a3cc74ab17ba9a9df0b52aedbe7252745db7274d5271fd79c1f08f668ecfa8eaab5626fa76adc811d3c8fc55859b0d09d3bc0a84eecd0ba891f2b8a2fc55141cdcc37c2053d53491e650a479967c3622762977900eddbf1252ed08a2413f00a28f3a0752a81203f03ccb7f684db373518b4" + + IL2026,IL2067,IL2075 diff --git a/Libraries/src/Amazon.Lambda.Core/SnapshotRestore.cs b/Libraries/src/Amazon.Lambda.Core/SnapshotRestore.cs new file mode 100644 index 000000000..87854bf01 --- /dev/null +++ b/Libraries/src/Amazon.Lambda.Core/SnapshotRestore.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Concurrent; +using System.Threading.Tasks; +namespace Amazon.Lambda.Core +{ +#if NET8_0_OR_GREATER + /// + /// Static class to register callback hooks to during the snapshot and restore phases of Lambda SnapStart. Hooks + /// should be registered as part of the constructor of the type containing the function handler or before the + /// `LambdaBootstrap` is started in executable assembly Lambda functions. + /// + public static class SnapshotRestore + { + // We don't want Amazon.Lambda.Core to have any dependencies because the packaged handler code + // that gets uploaded to AWS Lambda could have a version mismatch with the version that is already + // included in the managed runtime. This class allows us to define a simple API that both the + // RuntimeClient and handler code can use to register and then call these actions without + // depending on a specific version of SnapshotRestore.Registry. + private static readonly ConcurrentQueue> BeforeSnapshotRegistry = new(); + private static readonly ConcurrentQueue> AfterRestoreRegistry = new(); + + internal static void CopyBeforeSnapshotCallbacksToRegistry(Action> restoreHooksRegistryMethod) + { + // To preserve the order of registry, BeforeSnapshotRegistry in Core needs to be a Queue + // These callbacks will be added to the Stack that SnapshotRestore.Registry maintains + while (BeforeSnapshotRegistry.TryDequeue(out var registeredAction)) + { + restoreHooksRegistryMethod?.Invoke(registeredAction); + } + } + + internal static void CopyAfterRestoreCallbacksToRegistry(Action> restoreHooksRegistryMethod) + { + while (AfterRestoreRegistry.TryDequeue(out var registeredAction)) + { + restoreHooksRegistryMethod?.Invoke(registeredAction); + } + } + + /// + /// Register callback hook to be called before Lambda creates a snapshot of the running process. This can be used to warm code in the .NET process or close connections before the snapshot is taken. + /// + /// + public static void RegisterBeforeSnapshot(Func beforeSnapshotAction) + { + BeforeSnapshotRegistry.Enqueue(beforeSnapshotAction); + } + + /// + /// Register callback hook to be called after Lambda restores a snapshot of the running process. This can be used to ensure uniqueness after restoration. For example reseeding random number generators. + /// + /// + public static void RegisterAfterRestore(Func afterRestoreAction) + { + AfterRestoreRegistry.Enqueue(afterRestoreAction); + } + } +#endif +} \ No newline at end of file diff --git a/Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj b/Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj index bf1a5cf34..7cf4f87c9 100644 --- a/Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj +++ b/Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj @@ -4,7 +4,7 @@ netstandard2.0;net5.0;net6.0;net8.0 - 1.11.0 + 1.12.0 Provides a bootstrap and Lambda Runtime API Client to help you to develop custom .NET Core Lambda Runtimes. Amazon.Lambda.RuntimeSupport Amazon.Lambda.RuntimeSupport @@ -41,6 +41,9 @@ + + + Always diff --git a/Libraries/src/Amazon.Lambda.RuntimeSupport/Bootstrap/Constants.cs b/Libraries/src/Amazon.Lambda.RuntimeSupport/Bootstrap/Constants.cs index e3ef794f3..3b01339f3 100644 --- a/Libraries/src/Amazon.Lambda.RuntimeSupport/Bootstrap/Constants.cs +++ b/Libraries/src/Amazon.Lambda.RuntimeSupport/Bootstrap/Constants.cs @@ -32,6 +32,8 @@ internal class Constants internal const string ENVIRONMENT_VARIABLE_TELEMETRY_LOG_FD = "_LAMBDA_TELEMETRY_LOG_FD"; internal const string AWS_LAMBDA_INITIALIZATION_TYPE_PC = "provisioned-concurrency"; internal const string AWS_LAMBDA_INITIALIZATION_TYPE_ON_DEMAND = "on-demand"; + internal const string AWS_LAMBDA_INITIALIZATION_TYPE_SNAP_START = "snap-start"; + internal const string NET_RIC_LOG_LEVEL_ENVIRONMENT_VARIABLE = "AWS_LAMBDA_HANDLER_LOG_LEVEL"; internal const string NET_RIC_LOG_FORMAT_ENVIRONMENT_VARIABLE = "AWS_LAMBDA_HANDLER_LOG_FORMAT"; @@ -41,6 +43,9 @@ internal class Constants internal const string LAMBDA_LOG_FORMAT_JSON = "Json"; + internal const string LAMBDA_ERROR_TYPE_BEFORE_SNAPSHOT = "Runtime.BeforeSnapshotError"; + internal const string LAMBDA_ERROR_TYPE_AFTER_RESTORE = "Runtime.AfterRestoreError"; + internal enum AwsLambdaDotNetPreJit { Never, diff --git a/Libraries/src/Amazon.Lambda.RuntimeSupport/Bootstrap/LambdaBootstrap.cs b/Libraries/src/Amazon.Lambda.RuntimeSupport/Bootstrap/LambdaBootstrap.cs index 019d79ea8..fa7996a84 100644 --- a/Libraries/src/Amazon.Lambda.RuntimeSupport/Bootstrap/LambdaBootstrap.cs +++ b/Libraries/src/Amazon.Lambda.RuntimeSupport/Bootstrap/LambdaBootstrap.cs @@ -45,6 +45,7 @@ public class LambdaBootstrap : IDisposable private InternalLogger _logger = InternalLogger.GetDefaultLogger(); private HttpClient _httpClient; + private LambdaBootstrapConfiguration _configuration; internal IRuntimeApiClient Client { get; set; } /// @@ -65,7 +66,7 @@ public LambdaBootstrap(HttpClient httpClient, LambdaBootstrapHandler handler, La /// Delegate called to initialize the Lambda function. If not provided the initialization step is skipped. /// public LambdaBootstrap(LambdaBootstrapHandler handler, LambdaBootstrapInitializer initializer = null) - : this(ConstructHttpClient(), handler, initializer, ownsHttpClient: true) + : this(ConstructHttpClient(), handler, initializer, ownsHttpClient: true ) { } /// @@ -88,6 +89,18 @@ public LambdaBootstrap(HandlerWrapper handlerWrapper, LambdaBootstrapInitializer public LambdaBootstrap(HttpClient httpClient, HandlerWrapper handlerWrapper, LambdaBootstrapInitializer initializer = null) : this(httpClient, handlerWrapper.Handler, initializer, ownsHttpClient: false) { } + + /// + /// Create a LambdaBootstrap that will call the given initializer and handler with custom configuration. + /// + /// Delegate called for each invocation of the Lambda function. + /// Delegate called to initialize the Lambda function. If not provided the initialization step is skipped. + /// Get configuration to check if Invoke is with Pre JIT or SnapStart enabled + /// + internal LambdaBootstrap(LambdaBootstrapHandler handler, + LambdaBootstrapInitializer initializer, + LambdaBootstrapConfiguration configuration) : this(ConstructHttpClient(), handler, initializer, false, configuration) + { } /// /// Create a LambdaBootstrap that will call the given initializer and handler. @@ -97,7 +110,7 @@ public LambdaBootstrap(HttpClient httpClient, HandlerWrapper handlerWrapper, Lam /// Delegate called to initialize the Lambda function. If not provided the initialization step is skipped. /// Whether the instance owns the HTTP client and should dispose of it. /// - private LambdaBootstrap(HttpClient httpClient, LambdaBootstrapHandler handler, LambdaBootstrapInitializer initializer, bool ownsHttpClient) + private LambdaBootstrap(HttpClient httpClient, LambdaBootstrapHandler handler, LambdaBootstrapInitializer initializer, bool ownsHttpClient, LambdaBootstrapConfiguration configuration = null) { _httpClient = httpClient ?? throw new ArgumentNullException(nameof(httpClient)); _handler = handler ?? throw new ArgumentNullException(nameof(handler)); @@ -105,6 +118,7 @@ private LambdaBootstrap(HttpClient httpClient, LambdaBootstrapHandler handler, L _initializer = initializer; _httpClient.Timeout = RuntimeApiHttpTimeout; Client = new RuntimeApiClient(new SystemEnvironmentVariables(), _httpClient); + _configuration = configuration ?? LambdaBootstrapConfiguration.GetDefaultConfiguration(); } /// @@ -124,7 +138,7 @@ private LambdaBootstrap(HttpClient httpClient, LambdaBootstrapHandler handler, L AdjustMemorySettings(); #endif - if (UserCodeInit.IsCallPreJit()) + if (_configuration.IsCallPreJit) { this._logger.LogInformation("PreJit: CultureInfo"); UserCodeInit.LoadStringCultureInfo(); @@ -137,10 +151,41 @@ private LambdaBootstrap(HttpClient httpClient, LambdaBootstrapHandler handler, L // and then shut down cleanly. Useful for profiling or running local tests with the .NET Lambda Test Tool. This environment // variable should never be set when function is deployed to Lambda. var runOnce = string.Equals(Environment.GetEnvironmentVariable(Constants.ENVIRONMENT_VARIABLE_AWS_LAMBDA_DOTNET_DEBUG_RUN_ONCE), "true", StringComparison.OrdinalIgnoreCase); + + + if (_initializer != null && !(await InitializeAsync())) + { + return; + } +#if NET8_0_OR_GREATER + // Check if Initialization type is SnapStart, and invoke the snapshot restore logic. + if (_configuration.IsInitTypeSnapstart) + { + InternalLogger.GetDefaultLogger().LogInformation($"In LambdaBootstrap, Initializing with SnapStart."); - bool doStartInvokeLoop = _initializer == null || await InitializeAsync(); + object registry = null; + try + { + registry = SnapstartHelperCopySnapshotCallbacksIsolated.CopySnapshotCallbacks(); + } + catch (TypeLoadException ex) + { + 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); + } + // no exceptions in calling SnapStart hooks or /restore/next RAPID endpoint + if (!(await SnapstartHelperInitializeWithSnapstartIsolatedAsync.InitializeWithSnapstartAsync(Client, + registry))) + { + return; + }; + } +#endif - while (doStartInvokeLoop && !cancellationToken.IsCancellationRequested) + while (!cancellationToken.IsCancellationRequested) { try { @@ -168,8 +213,14 @@ internal async Task InitializeAsync() { WriteUnhandledExceptionToLog(exception); await Client.ReportInitializationErrorAsync(exception); - throw; +#if NET8_0_OR_GREATER + if (_configuration.IsInitTypeSnapstart) + { + System.Environment.Exit(1); // This needs to be non-zero for Lambda Sandbox to know that Runtime client encountered an exception + } +#endif } + return false; } internal async Task InvokeOnceAsync(CancellationToken cancellationToken = default) diff --git a/Libraries/src/Amazon.Lambda.RuntimeSupport/Client/IRuntimeApiClient.cs b/Libraries/src/Amazon.Lambda.RuntimeSupport/Client/IRuntimeApiClient.cs index 34b0162ec..8dbb34257 100644 --- a/Libraries/src/Amazon.Lambda.RuntimeSupport/Client/IRuntimeApiClient.cs +++ b/Libraries/src/Amazon.Lambda.RuntimeSupport/Client/IRuntimeApiClient.cs @@ -35,9 +35,10 @@ public interface IRuntimeApiClient /// Report an initialization error as an asynchronous operation. /// /// The exception to report. + /// An optional errorType string that can be used to log higher-context error to customer instead of generic Runtime.Unknown by the Lambda Sandbox. /// The optional cancellation token to use. /// A Task representing the asynchronous operation. - Task ReportInitializationErrorAsync(Exception exception, CancellationToken cancellationToken = default); + Task ReportInitializationErrorAsync(Exception exception, String errorType = null, CancellationToken cancellationToken = default); /// /// Send an initialization error with a type string but no other information as an asynchronous operation. @@ -64,7 +65,26 @@ public interface IRuntimeApiClient /// The optional cancellation token to use. /// A Task representing the asynchronous operation. Task ReportInvocationErrorAsync(string awsRequestId, Exception exception, CancellationToken cancellationToken = default); + +#if NET8_0_OR_GREATER + /// + /// Triggers the snapshot to be taken, and then after resume, restores the lambda + /// context from the Runtime API as an asynchronous operation when SnapStart is enabled. + /// + /// The optional cancellation token to use. + /// A Task representing the asynchronous operation. + Task RestoreNextInvocationAsync(CancellationToken cancellationToken = default); + /// + /// Report a restore error as an asynchronous operation when SnapStart is enabled. + /// + /// The exception to report. + /// An optional errorType string that can be used to log higher-context error to customer instead of generic Runtime.Unknown by the Lambda Sandbox. + /// The optional cancellation token to use. + /// A Task representing the asynchronous operation. + Task ReportRestoreErrorAsync(Exception exception, String errorType = null, CancellationToken cancellationToken = default); +#endif + /// /// Send a response to a function invocation to the Runtime API as an asynchronous operation. /// diff --git a/Libraries/src/Amazon.Lambda.RuntimeSupport/Client/InternalClientAdapted.cs b/Libraries/src/Amazon.Lambda.RuntimeSupport/Client/InternalClientAdapted.cs index 448f955c0..a3eeff854 100644 --- a/Libraries/src/Amazon.Lambda.RuntimeSupport/Client/InternalClientAdapted.cs +++ b/Libraries/src/Amazon.Lambda.RuntimeSupport/Client/InternalClientAdapted.cs @@ -14,9 +14,13 @@ */ +using System; +using System.IO; using System.Text.Json; using System.Net; using System.Text.Json.Serialization; +using System.Threading; +using System.Threading.Tasks; using Amazon.Lambda.RuntimeSupport.Helpers; namespace Amazon.Lambda.RuntimeSupport @@ -27,24 +31,27 @@ internal partial interface IInternalRuntimeApiClient /// Non-recoverable initialization error. Runtime should exit after reporting the error. Error will be served in response to the first invoke. /// Accepted /// A server side error occurred. - System.Threading.Tasks.Task> ErrorAsync(string lambda_Runtime_Function_Error_Type, string errorJson); + Task> ErrorAsync(string lambda_Runtime_Function_Error_Type, string errorJson, CancellationToken cancellationToken); + - /// Non-recoverable initialization error. Runtime should exit after reporting the error. Error will be served in response to the first invoke. - /// Accepted - /// A server side error occurred. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - System.Threading.Tasks.Task> ErrorAsync(string lambda_Runtime_Function_Error_Type, string errorJson, System.Threading.CancellationToken cancellationToken); - - /// Runtime makes this HTTP request when it is ready to receive and process a new invoke. - /// This is an iterator-style blocking API call. Response contains event JSON document, specific to the invoking service. +#if NET8_0_OR_GREATER + /// + /// Triggers the snapshot to be taken, and then after resume, restores the lambda + /// context from the Runtime API as an asynchronous operation when SnapStart is enabled. + /// + /// /// A Task representing the asynchronous operation. /// A server side error occurred. - System.Threading.Tasks.Task> NextAsync(); + System.Threading.Tasks.Task> RestoreNextAsync(CancellationToken cancellationToken); + Task> RestoreErrorAsync(string lambda_Runtime_Function_Error_Type, + string errorJson, CancellationToken cancellationToken); +#endif + /// Runtime makes this HTTP request when it is ready to receive and process a new invoke. /// This is an iterator-style blocking API call. Response contains event JSON document, specific to the invoking service. /// A server side error occurred. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - System.Threading.Tasks.Task> NextAsync(System.Threading.CancellationToken cancellationToken); + System.Threading.Tasks.Task> NextAsync(CancellationToken cancellationToken); + /// Runtime makes this request in order to submit a response. /// Accepted @@ -54,6 +61,8 @@ internal partial interface IInternalRuntimeApiClient /// Runtime makes this request in order to submit a response. /// Accepted /// A server side error occurred. + /// + /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. System.Threading.Tasks.Task> ResponseAsync(string awsRequestId, System.IO.Stream outputStream, System.Threading.CancellationToken cancellationToken); @@ -106,19 +115,17 @@ public string BaseUrl /// Non-recoverable initialization error. Runtime should exit after reporting the error. Error will be served in response to the first invoke. /// Accepted /// A server side error occurred. - public System.Threading.Tasks.Task> ErrorAsync(string lambda_Runtime_Function_Error_Type, string errorJson) + public Task> ErrorAsync(string lambda_Runtime_Function_Error_Type, string errorJson, CancellationToken cancellationToken) { - return ErrorAsync(lambda_Runtime_Function_Error_Type, errorJson, System.Threading.CancellationToken.None); + return ErrorAsync(lambda_Runtime_Function_Error_Type, errorJson, "/runtime/init/error", cancellationToken ); } - /// Non-recoverable initialization error. Runtime should exit after reporting the error. Error will be served in response to the first invoke. - /// Accepted - /// A server side error occurred. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - public async System.Threading.Tasks.Task> ErrorAsync(string lambda_Runtime_Function_Error_Type, string errorJson, System.Threading.CancellationToken cancellationToken) + private async System.Threading.Tasks.Task> ErrorAsync( + string lambda_Runtime_Function_Error_Type, string errorJson, string url, + System.Threading.CancellationToken cancellationToken) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/runtime/init/error"); + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append(url); var client_ = _httpClient; try @@ -215,16 +222,40 @@ public async System.Threading.Tasks.Task> ErrorA /// Runtime makes this HTTP request when it is ready to receive and process a new invoke. /// This is an iterator-style blocking API call. Response contains event JSON document, specific to the invoking service. /// A server side error occurred. - public System.Threading.Tasks.Task> NextAsync() + public System.Threading.Tasks.Task> NextAsync(CancellationToken cancellationToken) { - return NextAsync(System.Threading.CancellationToken.None); + return NextAsync("/runtime/invocation/next", cancellationToken); + } + +#if NET8_0_OR_GREATER + /// + /// Restores the lambda context from the Runtime API as an asynchronous operation when SnapStart is enabled + /// + /// A Task representing the asynchronous operation. + public Task> RestoreNextAsync(CancellationToken cancellationToken) + { + return NextAsync("/runtime/restore/next", cancellationToken); } + + /// Non-recoverable restore error when SnapStart is enabled. Runtime should exit after reporting the error. + /// A Task representing the asynchronous operation. + /// A server side error occurred. + public async Task> RestoreErrorAsync(string lambda_Runtime_Function_Error_Type, + string errorJson, CancellationToken cancellationToken) + { + return await ErrorAsync(lambda_Runtime_Function_Error_Type, errorJson, "/runtime/restore/error", cancellationToken); + + } +#endif + + /// Runtime makes this HTTP request when it is ready to receive and process a new invoke. /// This is an iterator-style blocking API call. Response contains event JSON document, specific to the invoking service. /// A server side error occurred. + /// RAPID API endpointUrl that is invoked to process the request /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - public async System.Threading.Tasks.Task> NextAsync(System.Threading.CancellationToken cancellationToken) + public async System.Threading.Tasks.Task> NextAsync(String endpointUrl, CancellationToken cancellationToken) { this._logger.LogInformation("Starting InternalClient.NextAsync"); @@ -234,9 +265,10 @@ public async System.Threading.Tasks.Task> ErrorA using (var request_ = new System.Net.Http.HttpRequestMessage()) { request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - var url_ = BaseUrl.TrimEnd('/') + "/runtime/invocation/next"; + var url_ = BaseUrl.TrimEnd('/') + endpointUrl; request_.RequestUri = new System.Uri(url_, System.UriKind.Absolute); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); @@ -306,6 +338,8 @@ public System.Threading.Tasks.Task> ResponseAsyn /// Runtime makes this request in order to submit a response. /// Accepted /// A server side error occurred. + /// + /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. public async System.Threading.Tasks.Task> ResponseAsync(string awsRequestId, System.IO.Stream outputStream, System.Threading.CancellationToken cancellationToken) { diff --git a/Libraries/src/Amazon.Lambda.RuntimeSupport/Client/RuntimeApiClient.cs b/Libraries/src/Amazon.Lambda.RuntimeSupport/Client/RuntimeApiClient.cs index 2cbc4cb83..f8e619f12 100644 --- a/Libraries/src/Amazon.Lambda.RuntimeSupport/Client/RuntimeApiClient.cs +++ b/Libraries/src/Amazon.Lambda.RuntimeSupport/Client/RuntimeApiClient.cs @@ -72,21 +72,22 @@ internal RuntimeApiClient(IEnvironmentVariables environmentVariables, IInternalR /// Report an initialization error as an asynchronous operation. /// /// The exception to report. + /// An optional errorType string that can be used to log higher-context error to customer instead of generic Runtime.Unknown by the Lambda Sandbox. /// The optional cancellation token to use. /// A Task representing the asynchronous operation. - public Task ReportInitializationErrorAsync(Exception exception, CancellationToken cancellationToken = default) + public Task ReportInitializationErrorAsync(Exception exception, String errorType = null, CancellationToken cancellationToken = default) { if (exception == null) throw new ArgumentNullException(nameof(exception)); - return _internalClient.ErrorAsync(null, LambdaJsonExceptionWriter.WriteJson(ExceptionInfo.GetExceptionInfo(exception)), cancellationToken); + return _internalClient.ErrorAsync(errorType, LambdaJsonExceptionWriter.WriteJson(ExceptionInfo.GetExceptionInfo(exception)), cancellationToken); } /// /// Send an initialization error with a type string but no other information as an asynchronous operation. /// This can be used to directly control flow in Step Functions without creating an Exception class and throwing it. /// - /// The type of the error to report to Lambda. This does not need to be a .NET type name. + /// The type of the error to report to Lambda. This does not need to be a .NET type name. /// The optional cancellation token to use. /// A Task representing the asynchronous operation. public Task ReportInitializationErrorAsync(string errorType, CancellationToken cancellationToken = default) @@ -140,6 +141,35 @@ public Task ReportInvocationErrorAsync(string awsRequestId, Exception exception, return _internalClient.ErrorWithXRayCauseAsync(awsRequestId, exceptionInfo.ErrorType, exceptionInfoJson, exceptionInfoXRayJson, cancellationToken); } + +#if NET8_0_OR_GREATER + + /// + /// Triggers the snapshot to be taken, and then after resume, restores the lambda + /// context from the Runtime API as an asynchronous operation when SnapStart is enabled. + /// + /// The optional cancellation token to use. + /// A Task representing the asynchronous operation. + public async Task RestoreNextInvocationAsync(CancellationToken cancellationToken = default) + { + await _internalClient.RestoreNextAsync(cancellationToken); + } + + /// + /// Report a restore error as an asynchronous operation when SnapStart is enabled. + /// + /// The exception to report. + /// An optional errorType string that can be used to log higher-context error to customer instead of generic Runtime.Unknown by the Lambda Sandbox. + /// The optional cancellation token to use. + /// A Task representing the asynchronous operation. + public Task ReportRestoreErrorAsync(Exception exception, String errorType = null, CancellationToken cancellationToken = default) + { + if (exception == null) + throw new ArgumentNullException(nameof(exception)); + + return _internalClient.RestoreErrorAsync(errorType, LambdaJsonExceptionWriter.WriteJson(ExceptionInfo.GetExceptionInfo(exception)), cancellationToken); + } +#endif /// diff --git a/Libraries/src/Amazon.Lambda.RuntimeSupport/Context/LambdaBootstrapConfiguration.cs b/Libraries/src/Amazon.Lambda.RuntimeSupport/Context/LambdaBootstrapConfiguration.cs new file mode 100644 index 000000000..84ea76615 --- /dev/null +++ b/Libraries/src/Amazon.Lambda.RuntimeSupport/Context/LambdaBootstrapConfiguration.cs @@ -0,0 +1,35 @@ +using System; +using Amazon.Lambda.RuntimeSupport.Bootstrap; +using Amazon.Lambda.RuntimeSupport.Helpers; + +namespace Amazon.Lambda.RuntimeSupport +{ + internal class LambdaBootstrapConfiguration + { + internal bool IsCallPreJit { get; set; } + internal bool IsInitTypeSnapstart { get; set; } + + internal LambdaBootstrapConfiguration(bool isCallPreJit, bool isInitTypeSnapstart) + { + if (IsInitTypeSnapstart) + InternalLogger.GetDefaultLogger().LogInformation("Setting Init type to SnapStart"); + + IsCallPreJit = isCallPreJit; + IsInitTypeSnapstart = isInitTypeSnapstart; + } + + internal static LambdaBootstrapConfiguration GetDefaultConfiguration() + { + bool isCallPreJit = UserCodeInit.IsCallPreJit(); +#if NET8_0_OR_GREATER + bool isInitTypeSnapstart = + string.Equals( + Environment.GetEnvironmentVariable(Constants.ENVIRONMENT_VARIABLE_AWS_LAMBDA_INITIALIZATION_TYPE), + Constants.AWS_LAMBDA_INITIALIZATION_TYPE_SNAP_START); + + return new LambdaBootstrapConfiguration(isCallPreJit, isInitTypeSnapstart); +#endif + return new LambdaBootstrapConfiguration(isCallPreJit, false); + } + } +} \ No newline at end of file diff --git a/Libraries/src/Amazon.Lambda.RuntimeSupport/Helpers/SnapstartHelperCopySnapshotCallbacksIsolated.cs b/Libraries/src/Amazon.Lambda.RuntimeSupport/Helpers/SnapstartHelperCopySnapshotCallbacksIsolated.cs new file mode 100644 index 000000000..740b29b0d --- /dev/null +++ b/Libraries/src/Amazon.Lambda.RuntimeSupport/Helpers/SnapstartHelperCopySnapshotCallbacksIsolated.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Amazon.Lambda.RuntimeSupport.Helpers +{ +#if NET8_0_OR_GREATER + internal static class SnapstartHelperCopySnapshotCallbacksIsolated + { + internal static object CopySnapshotCallbacks() + { + var logger = InternalLogger.GetDefaultLogger(); + var restoreHooksRegistry = new SnapshotRestore.Registry.RestoreHooksRegistry(logger.LogInformation); + Core.SnapshotRestore.CopyBeforeSnapshotCallbacksToRegistry(restoreHooksRegistry.RegisterBeforeSnapshot); + Core.SnapshotRestore.CopyAfterRestoreCallbacksToRegistry(restoreHooksRegistry.RegisterAfterRestore); + + return restoreHooksRegistry; + } + } +#endif +} diff --git a/Libraries/src/Amazon.Lambda.RuntimeSupport/Helpers/SnapstartHelperInitializeWithSnapstartIsolatedAsync.cs b/Libraries/src/Amazon.Lambda.RuntimeSupport/Helpers/SnapstartHelperInitializeWithSnapstartIsolatedAsync.cs new file mode 100644 index 000000000..e0874f50b --- /dev/null +++ b/Libraries/src/Amazon.Lambda.RuntimeSupport/Helpers/SnapstartHelperInitializeWithSnapstartIsolatedAsync.cs @@ -0,0 +1,54 @@ +using System; +using System.Threading.Tasks; +using Amazon.Lambda.RuntimeSupport.Bootstrap; + +namespace Amazon.Lambda.RuntimeSupport.Helpers +{ +#if NET8_0_OR_GREATER + /// + /// Anywhere this class is used in RuntimeSupport it should be wrapped around a try/catch block catching TypeLoadException. + /// If the version of Amazon.Lambda.Core in the deployment bundle is out of date the type that is accessing SnapshotRestore + /// will throw a TypeLoadException when the type is loaded. This extra layer for accessing SnapshotRestore is used so + /// classes like LambdaBootstrap can attempt accessing SnapshotRestore and catch the TypeLoadException if the type does not exist. + /// If LambdaBootstrap was to directly access SnapshotRestore from Amazon.Lambda.Core a TypeLoadException would be thrown + /// when LambdaBootstrap is loaded. + /// + internal static class SnapstartHelperInitializeWithSnapstartIsolatedAsync + { + /// + /// This function will invoke the beforeSnapshot hooks, restore lambda context and run the afterRestore hooks. + /// This will be used when SnapStart is enabled + /// + internal static async Task InitializeWithSnapstartAsync(IRuntimeApiClient client, object restoreHooksRegistry) + { + restoreHooksRegistry = restoreHooksRegistry == null ? new SnapshotRestore.Registry.RestoreHooksRegistry() : restoreHooksRegistry; + var logger = InternalLogger.GetDefaultLogger(); + try + { + await ((SnapshotRestore.Registry.RestoreHooksRegistry)restoreHooksRegistry).InvokeBeforeSnapshotCallbacks(); + await client.RestoreNextInvocationAsync(); + } + catch (Exception ex) + { + client.ConsoleLogger.FormattedWriteLine(LogLevelLoggerWriter.LogLevel.Error.ToString(), ex, + $"Failed to invoke before snapshot hooks: {ex}"); + await client.ReportInitializationErrorAsync(ex, Constants.LAMBDA_ERROR_TYPE_BEFORE_SNAPSHOT); + return false; + } + try + { + await ((SnapshotRestore.Registry.RestoreHooksRegistry)restoreHooksRegistry).InvokeAfterRestoreCallbacks(); + } + catch (Exception ex) + { + client.ConsoleLogger.FormattedWriteLine(LogLevelLoggerWriter.LogLevel.Error.ToString(), ex, + $"Failed to invoke after restore callables: {ex}"); + await client.ReportRestoreErrorAsync(ex, Constants.LAMBDA_ERROR_TYPE_AFTER_RESTORE); + return false; + } + + return true; + } + } +#endif +} diff --git a/Libraries/src/Amazon.Lambda.RuntimeSupport/Program.cs b/Libraries/src/Amazon.Lambda.RuntimeSupport/Program.cs index fd63562c8..b3c7f8d91 100644 --- a/Libraries/src/Amazon.Lambda.RuntimeSupport/Program.cs +++ b/Libraries/src/Amazon.Lambda.RuntimeSupport/Program.cs @@ -13,7 +13,10 @@ * permissions and limitations under the License. */ +using Amazon.Lambda.RuntimeSupport.Helpers; using System; +using System.IO; +using System.Runtime.Loader; using System.Threading.Tasks; namespace Amazon.Lambda.RuntimeSupport @@ -27,15 +30,32 @@ class Program #endif private static async Task Main(string[] args) { +#if NET8_0_OR_GREATER + AssemblyLoadContext.Default.Resolving += ResolveSnapshotRestoreAssembly; if (args.Length == 0) { throw new ArgumentException("The function handler was not provided via command line arguments.", nameof(args)); } - +#endif var handler = args[0]; RuntimeSupportInitializer runtimeSupportInitializer = new RuntimeSupportInitializer(handler); await runtimeSupportInitializer.RunLambdaBootstrap(); } + +#if NET8_0_OR_GREATER + [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("This code is only exercised in the class library programming model. Native AOT will not use this code path.")] + private static System.Reflection.Assembly ResolveSnapshotRestoreAssembly(AssemblyLoadContext assemblyContext, System.Reflection.AssemblyName assemblyName) + { + const string assemblyPath = "/var/runtime/SnapshotRestore.Registry.dll"; + InternalLogger.GetDefaultLogger().LogInformation("Resolving assembly: " + assemblyName.Name); + if (string.Equals(assemblyName.Name, "SnapshotRestore.Registry", StringComparison.InvariantCultureIgnoreCase) && File.Exists(assemblyPath)) + { + return assemblyContext.LoadFromAssemblyPath(assemblyPath); + } + + return null; + } +#endif } } diff --git a/Libraries/src/SnapshotRestore.Registry/README.md b/Libraries/src/SnapshotRestore.Registry/README.md new file mode 100644 index 000000000..73b0ef128 --- /dev/null +++ b/Libraries/src/SnapshotRestore.Registry/README.md @@ -0,0 +1,39 @@ +### Overview +The primary aim of this project is to develop a new API to register and retrieve tasks of type `ValueTask`. + +The class uses a `ConcurrentStack` and a `ConcurrentQueue` to store the registered hooks, which are `Func` objects. + +The `RegisterBeforeSnapshot` and `RegisterAfterRestore` methods allow users to register their own hooks, while the `InvokeBeforeSnapshotCallbacks` and `InvokeAfterRestoreCallbacks` methods allow the caller to invoke these snapstart hooks. + +This implementation is used for `Snapstart`, a feature that allows for quick restoration of application state. + +### Sample Usage + +``` +/// +/// Example class to demonstrate usage of SnapshotRestore.Registry library +/// +public class SnapstartExample +{ + private Guid _myExecutionEnvironmentGuid; + public SnapstartExample() + { + // This GUID is set for non-restore use-cases such as testing or if SnapStart is turned off + _myExecutionEnvironmentGuid = new Guid(); + // Register the method which will run after each restore. You may need to update Amazon.Lambda.Core to see this + Amazon.Lambda.Core.SnapshotRestore.RegisterAfterRestore(MyAfterRestore); + } + + private ValueTask MyAfterRestore() + { + // After we restore this snapshot to a new execution environment, update the GUID + _myExecutionEnvironmentGuid = new Guid(); + return ValueTask.CompletedTask; + } + + public string Handler() + { + return $"Hello World! My Execution Environment GUID is {_myExecutionEnvironmentGuid}"; + } +} +``` \ No newline at end of file diff --git a/Libraries/src/SnapshotRestore.Registry/RestoreHooksRegistry.cs b/Libraries/src/SnapshotRestore.Registry/RestoreHooksRegistry.cs new file mode 100644 index 000000000..e150643f8 --- /dev/null +++ b/Libraries/src/SnapshotRestore.Registry/RestoreHooksRegistry.cs @@ -0,0 +1,77 @@ +using System; +using System.Collections.Concurrent; +using System.Threading.Tasks; + +namespace SnapshotRestore.Registry; + +/// +/// .NET Implementation for Registering BeforeSnapshot and AfterRestore hooks +/// for Snapstart +/// +public class RestoreHooksRegistry +{ + private ConcurrentStack> _beforeSnapshotRegistry = new(); + private ConcurrentQueue> _afterRestoreRegistry = new(); + + private Action _logger; + + /// + /// Creates an instance of RestoreHooksRegistry. + /// + /// An optional callback logger. + public RestoreHooksRegistry(Action logger = null) + { + _logger = logger ?? (x => { }); + } + + /// + /// Register a ValueTask by adding it into the Before Snapshot Registry + /// + /// + public void RegisterBeforeSnapshot(Func func) + { + _beforeSnapshotRegistry.Push(func); + } + /// + /// Register a ValueTask by adding it into the After Restore Registry + /// + /// + public void RegisterAfterRestore(Func func) + { + _afterRestoreRegistry.Enqueue(func); + } + + /// + /// Invoke all the registered before snapshot callbacks. + /// + /// + public async Task InvokeBeforeSnapshotCallbacks() + { + if (_beforeSnapshotRegistry != null) + { + _logger($"Invoking {_beforeSnapshotRegistry.Count} beforeSnapshotCallables"); + while (_beforeSnapshotRegistry.TryPop(out var beforeSnapshotCallable)) + { + _logger($"Calling beforeSnapshotCallable: {beforeSnapshotCallable.Method.Name}"); + await beforeSnapshotCallable(); + } + } + } + + /// + /// Invoke all the registered after restore callbacks. + /// + /// + public async Task InvokeAfterRestoreCallbacks() + { + if (_afterRestoreRegistry != null) + { + _logger($"Invoking {_afterRestoreRegistry.Count} afterRestoreCallables"); + while (_afterRestoreRegistry.TryDequeue(out var afterRestoreCallable)) + { + _logger($"Calling afterRestoreCallable: {afterRestoreCallable.Method.Name}"); + await afterRestoreCallable(); + } + } + } +} \ No newline at end of file diff --git a/Libraries/src/SnapshotRestore.Registry/SnapshotRestore.Registry.csproj b/Libraries/src/SnapshotRestore.Registry/SnapshotRestore.Registry.csproj new file mode 100644 index 000000000..049fcf90e --- /dev/null +++ b/Libraries/src/SnapshotRestore.Registry/SnapshotRestore.Registry.csproj @@ -0,0 +1,25 @@ + + + + net8.0 + 1.0.0 + Provides a Restore Hooks library to help you register before snapshot and after restore hooks. + SnapshotRestore.Registry + SnapshotRestore.Registry + AWS;Amazon;Lambda + README.md + true + true + latest + IL2026,IL2067,IL2075 + true + true + Amazon Web Services + ..\..\..\buildtools\snapshotrestore.snk + true + + + + + + diff --git a/Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.IntegrationTests/Helpers/LambdaToolsHelper.cs b/Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.IntegrationTests/Helpers/LambdaToolsHelper.cs index 067d6f689..42a02aac6 100644 --- a/Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.IntegrationTests/Helpers/LambdaToolsHelper.cs +++ b/Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.IntegrationTests/Helpers/LambdaToolsHelper.cs @@ -70,6 +70,9 @@ private static void CopyDirectory(DirectoryInfo dir, string destDirName) foreach (var subdir in dirs) { + if (string.Equals(subdir.Name, ".vs", System.StringComparison.OrdinalIgnoreCase)) + continue; + var tempPath = Path.Combine(destDirName, subdir.Name); var subDir = new DirectoryInfo(subdir.FullName); CopyDirectory(subDir, tempPath); diff --git a/Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.IntegrationTests/IntegrationTestFixture.cs b/Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.IntegrationTests/IntegrationTestFixture.cs index eba66b47b..bc6ddad99 100644 --- a/Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.IntegrationTests/IntegrationTestFixture.cs +++ b/Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.IntegrationTests/IntegrationTestFixture.cs @@ -34,6 +34,7 @@ public async Task InitializeAsync() await LambdaToolsHelper.LambdaPackage(toolPath, "net6.0", testAppPath); } + public Task DisposeAsync() { foreach (var tempPath in _tempPaths) diff --git a/Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.UnitTests/Amazon.Lambda.RuntimeSupport.UnitTests.csproj b/Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.UnitTests/Amazon.Lambda.RuntimeSupport.UnitTests.csproj index 943c29ada..51b2e9fba 100644 --- a/Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.UnitTests/Amazon.Lambda.RuntimeSupport.UnitTests.csproj +++ b/Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.UnitTests/Amazon.Lambda.RuntimeSupport.UnitTests.csproj @@ -1,7 +1,9 @@  - + net8.0 + ..\..\..\..\buildtools\public.snk + true @@ -15,6 +17,7 @@ + diff --git a/Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.UnitTests/LambdaBootstrapTests.cs b/Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.UnitTests/LambdaBootstrapTests.cs index aeabdc108..44f20aa7e 100644 --- a/Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.UnitTests/LambdaBootstrapTests.cs +++ b/Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.UnitTests/LambdaBootstrapTests.cs @@ -83,13 +83,12 @@ public async Task NoInitializer() } [Fact] - public async Task InitializerThrowsException() + public async Task InitializerHandlesExceptionsGracefully() { using (var bootstrap = new LambdaBootstrap(_testFunction.BaseHandlerAsync, _testInitializer.InitializeThrowAsync)) { bootstrap.Client = _testRuntimeApiClient; - var exception = await Assert.ThrowsAsync(async () => { await bootstrap.RunAsync(); }); - Assert.Equal(TestInitializer.InitializeExceptionMessage, exception.Message); + await bootstrap.RunAsync(); } Assert.True(_testRuntimeApiClient.ReportInitializationErrorAsyncExceptionCalled); diff --git a/Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.UnitTests/SnapstartTests.cs b/Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.UnitTests/SnapstartTests.cs new file mode 100644 index 000000000..aaedf943a --- /dev/null +++ b/Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.UnitTests/SnapstartTests.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using static Amazon.Lambda.RuntimeSupport.Bootstrap.Constants; + +namespace Amazon.Lambda.RuntimeSupport.UnitTests; +public class SnapstartTests +{ + TestHandler _testFunction; + TestInitializer _testInitializer; + TestRuntimeApiClient _testRuntimeApiClient; + TestEnvironmentVariables _environmentVariables; + + public SnapstartTests() + { + _environmentVariables = new TestEnvironmentVariables(); + var headers = new Dictionary> + { + { + RuntimeApiHeaders.HeaderAwsRequestId, new List { "request_id" } + }, + { + RuntimeApiHeaders.HeaderInvokedFunctionArn, new List { "invoked_function_arn" } + } + }; + _testRuntimeApiClient = new TestRuntimeApiClient(_environmentVariables, headers); + _testInitializer = new TestInitializer(); + _testFunction = new TestHandler(); + } + + [Fact] + public async void VerifyRestoreNextIsCalledWhenSnapstartIsEnabled() + { + using var bootstrap = + new LambdaBootstrap(_testFunction.BaseHandlerAsync, _testInitializer.InitializeTrueAsync, configuration: new LambdaBootstrapConfiguration(false, true)); + bootstrap.Client = _testRuntimeApiClient; + await bootstrap.RunAsync(_testFunction.CancellationSource.Token); + Assert.True(_testRuntimeApiClient.RestoreNextInvocationAsyncCalled); + } + + [Fact] + public async void VerifyRestoreNextIsNotCalledWhenSnapstartIsDisabled() + { + using var bootstrap = + new LambdaBootstrap(_testFunction.BaseHandlerAsync, _testInitializer.InitializeTrueAsync, configuration: new LambdaBootstrapConfiguration(false, false)); + bootstrap.Client = _testRuntimeApiClient; + Environment.SetEnvironmentVariable(ENVIRONMENT_VARIABLE_AWS_LAMBDA_INITIALIZATION_TYPE, AWS_LAMBDA_INITIALIZATION_TYPE_ON_DEMAND); + await bootstrap.RunAsync(_testFunction.CancellationSource.Token); + Assert.False(_testRuntimeApiClient.RestoreNextInvocationAsyncCalled); + } + + + [Fact] + public async void VerifyInitializeErrorIsCalledWhenExceptionInBeforeSnapshotCallables() + { + using var bootstrap = + new LambdaBootstrap(_testFunction.BaseHandlerAsync, _testInitializer.InitializeTrueAsync, configuration: new LambdaBootstrapConfiguration(false, true)); + bootstrap.Client = _testRuntimeApiClient; + Core.SnapshotRestore.RegisterBeforeSnapshot( + () => throw new Exception("Error in Before snapshot callable 1")); + Core.SnapshotRestore.RegisterBeforeSnapshot(() => ValueTask.CompletedTask); + await bootstrap.RunAsync(_testFunction.CancellationSource.Token); + Assert.True(_testRuntimeApiClient.ReportInitializationErrorAsyncExceptionCalled); + } + + [Fact] + public async void VerifyRestoreErrorIsCalledWhenExceptionInAfterRestoreCallables() + { + using (var bootstrap = + new LambdaBootstrap(_testFunction.BaseHandlerAsync, _testInitializer.InitializeTrueAsync, new LambdaBootstrapConfiguration(false, true))) + { + bootstrap.Client = _testRuntimeApiClient; + Core.SnapshotRestore.RegisterAfterRestore(() => ValueTask.CompletedTask); + Core.SnapshotRestore.RegisterAfterRestore(() => throw new Exception("Error in After restore callable 1")); + await bootstrap.RunAsync(_testFunction.CancellationSource.Token); + Assert.True(_testRuntimeApiClient.ReportRestoreErrorAsyncCalled); + } + } +} \ No newline at end of file diff --git a/Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.UnitTests/TestHelpers/TestRuntimeApiClient.cs b/Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.UnitTests/TestHelpers/TestRuntimeApiClient.cs index bf449e803..ef500e746 100644 --- a/Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.UnitTests/TestHelpers/TestRuntimeApiClient.cs +++ b/Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.UnitTests/TestHelpers/TestRuntimeApiClient.cs @@ -38,6 +38,10 @@ public TestRuntimeApiClient(IEnvironmentVariables environmentVariables, Dictiona } public bool GetNextInvocationAsyncCalled { get; private set; } + public bool RestoreNextInvocationAsyncCalled { get; private set; } + public bool ReportRestoreErrorAsyncCalled { get; private set; } + + public bool ReportInitializationErrorAsyncExceptionCalled { get; private set; } public bool ReportInitializationErrorAsyncTypeCalled { get; private set; } public bool ReportInvocationErrorAsyncExceptionCalled { get; private set; } @@ -98,8 +102,14 @@ public Task GetNextInvocationAsync(CancellationToken cancella new TestDateTimeHelper(), new Helpers.SimpleLoggerWriter()) }); } + + public Task RestoreNextInvocationAsync(CancellationToken cancellationToken = default) + { + RestoreNextInvocationAsyncCalled = true; + return Task.Run(() => { }); + } - public Task ReportInitializationErrorAsync(Exception exception, CancellationToken cancellationToken = default) + public Task ReportInitializationErrorAsync(Exception exception, String errorType = null, CancellationToken cancellationToken = default) { LastRecordedException = exception; ReportInitializationErrorAsyncExceptionCalled = true; @@ -124,6 +134,13 @@ public Task ReportInvocationErrorAsync(string awsRequestId, string errorType, Ca ReportInvocationErrorAsyncTypeCalled = true; return Task.Run(() => { }); } + + public Task ReportRestoreErrorAsync(Exception exception, String errorType = null, CancellationToken cancellationToken = default) + { + ReportRestoreErrorAsyncCalled = true; + + + return Task.Run(() => { }); } public Task SendResponseAsync(string awsRequestId, Stream outputStream, CancellationToken cancellationToken = default) { diff --git a/Libraries/test/SnapshotRestore.Registry.Tests/RestoreHooksRegistryTests.cs b/Libraries/test/SnapshotRestore.Registry.Tests/RestoreHooksRegistryTests.cs new file mode 100644 index 000000000..37ef4267f --- /dev/null +++ b/Libraries/test/SnapshotRestore.Registry.Tests/RestoreHooksRegistryTests.cs @@ -0,0 +1,90 @@ +using System; +using Xunit; +namespace SnapshotRestore.Registry.Tests; + +public class RestoreHooksRegistryTests +{ + private DateTimeOffset? _func1InvokeTime = null; + private DateTimeOffset? _func2InvokeTime = null; + + [Fact] + public async Task RegisterBeforeSnapshotAsyncShouldAddValueTaskToRegistryAsync() + { + // Arrange + _func1InvokeTime = null; + _func2InvokeTime = null; + RestoreHooksRegistry registry = new(Console.WriteLine); + registry.RegisterBeforeSnapshot(TestFunc1); + registry.RegisterBeforeSnapshot(TestFunc2); + + // Act + await registry.InvokeBeforeSnapshotCallbacks(); + + // Assert + Assert.NotNull(_func1InvokeTime); + Assert.NotNull(_func2InvokeTime); + Assert.True(_func2InvokeTime < _func1InvokeTime, "func2InvokeTime should be less than func1InvokeTime, " + + "since func2InvokeTime was registered second, and BeforeSnapshot " + + "tasks are called in the reverse order they were registered."); + } + + [Fact] + public async Task RegisterAfterRestoreAsync_ShouldAddValueTaskToRegistryAsync() + { + // Arrange + _func1InvokeTime = null; + _func2InvokeTime = null; + RestoreHooksRegistry registry = new(Console.WriteLine); + registry.RegisterAfterRestore(TestFunc1); + registry.RegisterAfterRestore(TestFunc2); + + // Act + await registry.InvokeAfterRestoreCallbacks(); + + // Assert + Assert.NotNull(_func1InvokeTime); + Assert.NotNull(_func2InvokeTime); + Assert.True(_func1InvokeTime < _func2InvokeTime, "func1InvokeTime should be less than or equal to " + + "func2InvokeTime, since it was registered first, and AfterRestore " + + "tasks are called in the order they were registered."); + } + + [Fact] + public async Task LoggerIsNotRequired() + { + // Arrange + RestoreHooksRegistry registry = new(logger: null); + registry.RegisterAfterRestore(TestFunc1); + registry.RegisterAfterRestore(TestFunc2); + + Exception? exception = null; + + // Act + try + { + await registry.InvokeAfterRestoreCallbacks(); + } + catch (Exception e) + { + exception = e; + } + + // Assert + Assert.Null(exception); + } + + + private ValueTask TestFunc1() + { + _func1InvokeTime = DateTimeOffset.UtcNow; + Thread.Sleep(10); // So the times of func1 and func2 aren't ever exactly equal + return ValueTask.CompletedTask; + } + + private ValueTask TestFunc2() + { + _func2InvokeTime = DateTimeOffset.UtcNow; + Thread.Sleep(10); // So the times of func1 and func2 aren't ever exactly equal + return ValueTask.CompletedTask; + } +} \ No newline at end of file diff --git a/Libraries/test/SnapshotRestore.Registry.Tests/SnapshotRestore.Registry.Tests.csproj b/Libraries/test/SnapshotRestore.Registry.Tests/SnapshotRestore.Registry.Tests.csproj new file mode 100644 index 000000000..dd41e38a4 --- /dev/null +++ b/Libraries/test/SnapshotRestore.Registry.Tests/SnapshotRestore.Registry.Tests.csproj @@ -0,0 +1,19 @@ + + + + net8.0 + enable + enable + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + diff --git a/buildtools/build.proj b/buildtools/build.proj index 90d792318..bb9ac9a43 100644 --- a/buildtools/build.proj +++ b/buildtools/build.proj @@ -194,6 +194,7 @@ + diff --git a/buildtools/snapshotrestore.snk b/buildtools/snapshotrestore.snk new file mode 100644 index 0000000000000000000000000000000000000000..1cc91de316b19d356f28f672dc0c43db843baa9f GIT binary patch literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa50096s2%7=D;yhm!FQ;4y*rn2U7#QVbb`+sR zAFZ6StdSF4xjq#!)UL{}t3N=A%tw0w+j}5pX?w`r87%2KxvzNH>($>b)_en}|*l#UM`Vg<|6EoUHSzBAA(>Zi=ln+<2N~{pMHw=@lOfYp~eEy+B zF9BdXzl+sU>*P5El7}jKVvU*`SJTx|qD%!}9-JW;d(JW2!40&A5Rd3HjC*~lXl|O2 zdKmV7ajc?RUnkBd2R4hiY^?zD2*>jxMvG-1YkRW7&wv=CQ}hF z&5@lefB-PTP`IWi4CB}3dYTVvaV6^%EC0tt54-3;qO*P1S+p(scAjA198V93>Tl&@ zwC57`=i|qbLApUftlEF3ImC=iT;5v`cM;$>$#_XM%Km4+cYB!UA!Jqp!_JUqd`pzs zk3?%?!>$iLvN@a{klo0CVmZfMQZQr>CTR4@JVIAbPOn4QgK@OM9V4{@FpETe?pNVl z`Dw54o~k5i3ykQL&Oh#9 Date: Tue, 19 Nov 2024 15:59:57 -0800 Subject: [PATCH 07/25] Version bump libraries to pull in SnapStart versions of Core and RuntimeSupport (#1877) --- .../changes/0051061b-e1cc-4f12-8fb0-852ac35c6b12.json | 11 +++++++++++ .../changes/1b19409c-0e77-4d90-a0f0-fdb9d45ba204.json | 11 +++++++++++ .../changes/2d313695-2697-463b-926f-f9186bb384e8.json | 11 +++++++++++ .../changes/5a533ad1-1760-475b-9ac4-69d53bf9ebf1.json | 11 +++++++++++ .../changes/86fe00ab-010e-42bd-a25b-4fe37a84a798.json | 11 +++++++++++ 5 files changed, 55 insertions(+) create mode 100644 .autover/changes/0051061b-e1cc-4f12-8fb0-852ac35c6b12.json create mode 100644 .autover/changes/1b19409c-0e77-4d90-a0f0-fdb9d45ba204.json create mode 100644 .autover/changes/2d313695-2697-463b-926f-f9186bb384e8.json create mode 100644 .autover/changes/5a533ad1-1760-475b-9ac4-69d53bf9ebf1.json create mode 100644 .autover/changes/86fe00ab-010e-42bd-a25b-4fe37a84a798.json diff --git a/.autover/changes/0051061b-e1cc-4f12-8fb0-852ac35c6b12.json b/.autover/changes/0051061b-e1cc-4f12-8fb0-852ac35c6b12.json new file mode 100644 index 000000000..d67a1972f --- /dev/null +++ b/.autover/changes/0051061b-e1cc-4f12-8fb0-852ac35c6b12.json @@ -0,0 +1,11 @@ +{ + "Projects": [ + { + "Name": "Amazon.Lambda.PowerShellHost", + "Type": "Patch", + "ChangelogMessages": [ + "Update to latest version of Amazon.Lambda.Core" + ] + } + ] +} \ No newline at end of file diff --git a/.autover/changes/1b19409c-0e77-4d90-a0f0-fdb9d45ba204.json b/.autover/changes/1b19409c-0e77-4d90-a0f0-fdb9d45ba204.json new file mode 100644 index 000000000..85bc52545 --- /dev/null +++ b/.autover/changes/1b19409c-0e77-4d90-a0f0-fdb9d45ba204.json @@ -0,0 +1,11 @@ +{ + "Projects": [ + { + "Name": "Amazon.Lambda.Logging.AspNetCore", + "Type": "Patch", + "ChangelogMessages": [ + "Update to latest version of Amazon.Lambda.Core" + ] + } + ] +} \ No newline at end of file diff --git a/.autover/changes/2d313695-2697-463b-926f-f9186bb384e8.json b/.autover/changes/2d313695-2697-463b-926f-f9186bb384e8.json new file mode 100644 index 000000000..31b61a08f --- /dev/null +++ b/.autover/changes/2d313695-2697-463b-926f-f9186bb384e8.json @@ -0,0 +1,11 @@ +{ + "Projects": [ + { + "Name": "Amazon.Lambda.Annotations", + "Type": "Patch", + "ChangelogMessages": [ + "Update to latest version of Amazon.Lambda.Core" + ] + } + ] +} \ No newline at end of file diff --git a/.autover/changes/5a533ad1-1760-475b-9ac4-69d53bf9ebf1.json b/.autover/changes/5a533ad1-1760-475b-9ac4-69d53bf9ebf1.json new file mode 100644 index 000000000..b4d1c1c59 --- /dev/null +++ b/.autover/changes/5a533ad1-1760-475b-9ac4-69d53bf9ebf1.json @@ -0,0 +1,11 @@ +{ + "Projects": [ + { + "Name": "Amazon.Lambda.AspNetCoreServer.Hosting", + "Type": "Patch", + "ChangelogMessages": [ + "Update to latest version of Amazon.Lambda.Core and Amazon.Lambda.RuntimeSupport" + ] + } + ] +} \ No newline at end of file diff --git a/.autover/changes/86fe00ab-010e-42bd-a25b-4fe37a84a798.json b/.autover/changes/86fe00ab-010e-42bd-a25b-4fe37a84a798.json new file mode 100644 index 000000000..5f95e17ee --- /dev/null +++ b/.autover/changes/86fe00ab-010e-42bd-a25b-4fe37a84a798.json @@ -0,0 +1,11 @@ +{ + "Projects": [ + { + "Name": "Amazon.Lambda.AspNetCoreServer", + "Type": "Patch", + "ChangelogMessages": [ + "Update to latest version of Amazon.Lambda.Core" + ] + } + ] +} \ No newline at end of file From 6f06f19b95a38964427d19eb20f6ce4d542dc147 Mon Sep 17 00:00:00 2001 From: aws-sdk-dotnet-automation <43080735+aws-sdk-dotnet-automation@users.noreply.github.com> Date: Tue, 19 Nov 2024 19:03:03 -0500 Subject: [PATCH 08/25] Release 2024-11-20 (#1878) * release_2024-11-20 * Update test app CloudFormation templates * Updated changelog --- .../0051061b-e1cc-4f12-8fb0-852ac35c6b12.json | 11 ----------- .../1b19409c-0e77-4d90-a0f0-fdb9d45ba204.json | 11 ----------- .../2d313695-2697-463b-926f-f9186bb384e8.json | 11 ----------- .../5a533ad1-1760-475b-9ac4-69d53bf9ebf1.json | 11 ----------- .../86fe00ab-010e-42bd-a25b-4fe37a84a798.json | 11 ----------- CHANGELOG.md | 13 +++++++++++++ ...Amazon.Lambda.Annotations.SourceGenerator.csproj | 4 ++-- .../Amazon.Lambda.Annotations.csproj | 4 ++-- .../Amazon.Lambda.AspNetCoreServer.Hosting.csproj | 6 +++--- .../Amazon.Lambda.AspNetCoreServer.csproj | 4 ++-- .../Amazon.Lambda.Logging.AspNetCore.csproj | 4 ++-- .../Amazon.Lambda.PowerShellHost.csproj | 4 ++-- .../TestExecutableServerlessApp/serverless.template | 2 +- .../test/TestServerlessApp.NET8/serverless.template | 2 +- .../test/TestServerlessApp/serverless.template | 2 +- 15 files changed, 29 insertions(+), 71 deletions(-) delete mode 100644 .autover/changes/0051061b-e1cc-4f12-8fb0-852ac35c6b12.json delete mode 100644 .autover/changes/1b19409c-0e77-4d90-a0f0-fdb9d45ba204.json delete mode 100644 .autover/changes/2d313695-2697-463b-926f-f9186bb384e8.json delete mode 100644 .autover/changes/5a533ad1-1760-475b-9ac4-69d53bf9ebf1.json delete mode 100644 .autover/changes/86fe00ab-010e-42bd-a25b-4fe37a84a798.json diff --git a/.autover/changes/0051061b-e1cc-4f12-8fb0-852ac35c6b12.json b/.autover/changes/0051061b-e1cc-4f12-8fb0-852ac35c6b12.json deleted file mode 100644 index d67a1972f..000000000 --- a/.autover/changes/0051061b-e1cc-4f12-8fb0-852ac35c6b12.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "Projects": [ - { - "Name": "Amazon.Lambda.PowerShellHost", - "Type": "Patch", - "ChangelogMessages": [ - "Update to latest version of Amazon.Lambda.Core" - ] - } - ] -} \ No newline at end of file diff --git a/.autover/changes/1b19409c-0e77-4d90-a0f0-fdb9d45ba204.json b/.autover/changes/1b19409c-0e77-4d90-a0f0-fdb9d45ba204.json deleted file mode 100644 index 85bc52545..000000000 --- a/.autover/changes/1b19409c-0e77-4d90-a0f0-fdb9d45ba204.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "Projects": [ - { - "Name": "Amazon.Lambda.Logging.AspNetCore", - "Type": "Patch", - "ChangelogMessages": [ - "Update to latest version of Amazon.Lambda.Core" - ] - } - ] -} \ No newline at end of file diff --git a/.autover/changes/2d313695-2697-463b-926f-f9186bb384e8.json b/.autover/changes/2d313695-2697-463b-926f-f9186bb384e8.json deleted file mode 100644 index 31b61a08f..000000000 --- a/.autover/changes/2d313695-2697-463b-926f-f9186bb384e8.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "Projects": [ - { - "Name": "Amazon.Lambda.Annotations", - "Type": "Patch", - "ChangelogMessages": [ - "Update to latest version of Amazon.Lambda.Core" - ] - } - ] -} \ No newline at end of file diff --git a/.autover/changes/5a533ad1-1760-475b-9ac4-69d53bf9ebf1.json b/.autover/changes/5a533ad1-1760-475b-9ac4-69d53bf9ebf1.json deleted file mode 100644 index b4d1c1c59..000000000 --- a/.autover/changes/5a533ad1-1760-475b-9ac4-69d53bf9ebf1.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "Projects": [ - { - "Name": "Amazon.Lambda.AspNetCoreServer.Hosting", - "Type": "Patch", - "ChangelogMessages": [ - "Update to latest version of Amazon.Lambda.Core and Amazon.Lambda.RuntimeSupport" - ] - } - ] -} \ No newline at end of file diff --git a/.autover/changes/86fe00ab-010e-42bd-a25b-4fe37a84a798.json b/.autover/changes/86fe00ab-010e-42bd-a25b-4fe37a84a798.json deleted file mode 100644 index 5f95e17ee..000000000 --- a/.autover/changes/86fe00ab-010e-42bd-a25b-4fe37a84a798.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "Projects": [ - { - "Name": "Amazon.Lambda.AspNetCoreServer", - "Type": "Patch", - "ChangelogMessages": [ - "Update to latest version of Amazon.Lambda.Core" - ] - } - ] -} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index c1145ebd3..c21af9977 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +## Release 2024-11-20 + +### Amazon.Lambda.PowerShellHost (3.0.2) +* Update to latest version of Amazon.Lambda.Core +### Amazon.Lambda.Logging.AspNetCore (3.1.1) +* Update to latest version of Amazon.Lambda.Core +### Amazon.Lambda.Annotations (1.6.1) +* Update to latest version of Amazon.Lambda.Core +### Amazon.Lambda.AspNetCoreServer.Hosting (1.7.2) +* Update to latest version of Amazon.Lambda.Core and Amazon.Lambda.RuntimeSupport +### Amazon.Lambda.AspNetCoreServer (9.0.2) +* Update to latest version of Amazon.Lambda.Core + ## Release 2024-11-18 ### Amazon.Lambda.Core (2.5.0) diff --git a/Libraries/src/Amazon.Lambda.Annotations.SourceGenerator/Amazon.Lambda.Annotations.SourceGenerator.csproj b/Libraries/src/Amazon.Lambda.Annotations.SourceGenerator/Amazon.Lambda.Annotations.SourceGenerator.csproj index 8762d6244..532f007e4 100644 --- a/Libraries/src/Amazon.Lambda.Annotations.SourceGenerator/Amazon.Lambda.Annotations.SourceGenerator.csproj +++ b/Libraries/src/Amazon.Lambda.Annotations.SourceGenerator/Amazon.Lambda.Annotations.SourceGenerator.csproj @@ -1,4 +1,4 @@ - + netstandard2.0;net6.0;net8.0 @@ -19,7 +19,7 @@ true false - 1.6.0 + 1.6.1 diff --git a/Libraries/src/Amazon.Lambda.Annotations/Amazon.Lambda.Annotations.csproj b/Libraries/src/Amazon.Lambda.Annotations/Amazon.Lambda.Annotations.csproj index 348c49695..9649188ee 100644 --- a/Libraries/src/Amazon.Lambda.Annotations/Amazon.Lambda.Annotations.csproj +++ b/Libraries/src/Amazon.Lambda.Annotations/Amazon.Lambda.Annotations.csproj @@ -1,4 +1,4 @@ - + Amazon.Lambda.Annotations @@ -11,7 +11,7 @@ ..\..\..\buildtools\public.snk true - 1.6.0 + 1.6.1 diff --git a/Libraries/src/Amazon.Lambda.AspNetCoreServer.Hosting/Amazon.Lambda.AspNetCoreServer.Hosting.csproj b/Libraries/src/Amazon.Lambda.AspNetCoreServer.Hosting/Amazon.Lambda.AspNetCoreServer.Hosting.csproj index cdf49d877..2afda60bc 100644 --- a/Libraries/src/Amazon.Lambda.AspNetCoreServer.Hosting/Amazon.Lambda.AspNetCoreServer.Hosting.csproj +++ b/Libraries/src/Amazon.Lambda.AspNetCoreServer.Hosting/Amazon.Lambda.AspNetCoreServer.Hosting.csproj @@ -1,4 +1,4 @@ - + @@ -7,7 +7,7 @@ net6.0;net8.0 enable enable - 1.7.1 + 1.7.2 README.md Amazon.Lambda.AspNetCoreServer.Hosting Amazon.Lambda.AspNetCoreServer.Hosting @@ -18,7 +18,7 @@ - + diff --git a/Libraries/src/Amazon.Lambda.AspNetCoreServer/Amazon.Lambda.AspNetCoreServer.csproj b/Libraries/src/Amazon.Lambda.AspNetCoreServer/Amazon.Lambda.AspNetCoreServer.csproj index 2f66e4d34..43aab872b 100644 --- a/Libraries/src/Amazon.Lambda.AspNetCoreServer/Amazon.Lambda.AspNetCoreServer.csproj +++ b/Libraries/src/Amazon.Lambda.AspNetCoreServer/Amazon.Lambda.AspNetCoreServer.csproj @@ -1,4 +1,4 @@ - + @@ -6,7 +6,7 @@ Amazon.Lambda.AspNetCoreServer makes it easy to run ASP.NET Core Web API applications as AWS Lambda functions. net6.0;net8.0 Amazon.Lambda.AspNetCoreServer - 9.0.1 + 9.0.2 Amazon.Lambda.AspNetCoreServer Amazon.Lambda.AspNetCoreServer AWS;Amazon;Lambda;aspnetcore diff --git a/Libraries/src/Amazon.Lambda.Logging.AspNetCore/Amazon.Lambda.Logging.AspNetCore.csproj b/Libraries/src/Amazon.Lambda.Logging.AspNetCore/Amazon.Lambda.Logging.AspNetCore.csproj index 483f4d495..7d394b38a 100644 --- a/Libraries/src/Amazon.Lambda.Logging.AspNetCore/Amazon.Lambda.Logging.AspNetCore.csproj +++ b/Libraries/src/Amazon.Lambda.Logging.AspNetCore/Amazon.Lambda.Logging.AspNetCore.csproj @@ -1,4 +1,4 @@ - + @@ -6,7 +6,7 @@ Amazon Lambda .NET Core support - Logging ASP.NET Core package. netstandard2.0 Amazon.Lambda.Logging.AspNetCore - 3.1.0 + 3.1.1 Amazon.Lambda.Logging.AspNetCore Amazon.Lambda.Logging.AspNetCore AWS;Amazon;Lambda;Logging diff --git a/Libraries/src/Amazon.Lambda.PowerShellHost/Amazon.Lambda.PowerShellHost.csproj b/Libraries/src/Amazon.Lambda.PowerShellHost/Amazon.Lambda.PowerShellHost.csproj index fb882a94c..3032ec0ce 100644 --- a/Libraries/src/Amazon.Lambda.PowerShellHost/Amazon.Lambda.PowerShellHost.csproj +++ b/Libraries/src/Amazon.Lambda.PowerShellHost/Amazon.Lambda.PowerShellHost.csproj @@ -1,4 +1,4 @@ - + @@ -6,7 +6,7 @@ net6.0;net8.0 AWS Lambda PowerShell Host. Amazon.Lambda.PowerShellHost - 3.0.1 + 3.0.2 Amazon.Lambda.PowerShellHost Amazon.Lambda.PowerShellHost AWS;Amazon;Lambda;PowerShell diff --git a/Libraries/test/TestExecutableServerlessApp/serverless.template b/Libraries/test/TestExecutableServerlessApp/serverless.template index e816a4237..a7b5e3bb4 100644 --- a/Libraries/test/TestExecutableServerlessApp/serverless.template +++ b/Libraries/test/TestExecutableServerlessApp/serverless.template @@ -1,7 +1,7 @@ { "AWSTemplateFormatVersion": "2010-09-09", "Transform": "AWS::Serverless-2016-10-31", - "Description": "An AWS Serverless Application. This template is partially managed by Amazon.Lambda.Annotations (v1.6.0.0).", + "Description": "An AWS Serverless Application. This template is partially managed by Amazon.Lambda.Annotations (v1.6.1.0).", "Parameters": { "ArchitectureTypeParameter": { "Type": "String", diff --git a/Libraries/test/TestServerlessApp.NET8/serverless.template b/Libraries/test/TestServerlessApp.NET8/serverless.template index a7ef4fbfe..1d1e21c3c 100644 --- a/Libraries/test/TestServerlessApp.NET8/serverless.template +++ b/Libraries/test/TestServerlessApp.NET8/serverless.template @@ -1,7 +1,7 @@ { "AWSTemplateFormatVersion": "2010-09-09", "Transform": "AWS::Serverless-2016-10-31", - "Description": "This template is partially managed by Amazon.Lambda.Annotations (v1.6.0.0).", + "Description": "This template is partially managed by Amazon.Lambda.Annotations (v1.6.1.0).", "Resources": { "TestServerlessAppNET8FunctionsToUpperGenerated": { "Type": "AWS::Serverless::Function", diff --git a/Libraries/test/TestServerlessApp/serverless.template b/Libraries/test/TestServerlessApp/serverless.template index 32102ed2b..26f98e4da 100644 --- a/Libraries/test/TestServerlessApp/serverless.template +++ b/Libraries/test/TestServerlessApp/serverless.template @@ -1,7 +1,7 @@ { "AWSTemplateFormatVersion": "2010-09-09", "Transform": "AWS::Serverless-2016-10-31", - "Description": "An AWS Serverless Application. This template is partially managed by Amazon.Lambda.Annotations (v1.6.0.0).", + "Description": "An AWS Serverless Application. This template is partially managed by Amazon.Lambda.Annotations (v1.6.1.0).", "Parameters": { "ArchitectureTypeParameter": { "Type": "String", From 8f8e5a347d8fb20d5b785d306cf2c6c66ea5c6d9 Mon Sep 17 00:00:00 2001 From: Norm Johanson Date: Mon, 25 Nov 2024 10:35:07 -0800 Subject: [PATCH 09/25] Update Lambda blueprint to include version of Amazon.Lambda.Core and Amazon.Lambda.RuntimeSupport that support SnapStart (#1880) --- .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 4 ++-- .../template/src/BlueprintBaseName.1/serverless.template | 2 +- .../BlueprintBaseName.1.Tests.csproj | 2 +- .../src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj | 2 +- .../BlueprintBaseName.1.Tests.fsproj | 5 +++-- .../test/BlueprintBaseName.1.Tests/ValuesControllerTests.fs | 3 --- .../src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj | 2 +- .../BlueprintBaseName.1.Tests.fsproj | 2 +- .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 2 +- .../BlueprintBaseName.1.Tests.csproj | 2 +- .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 2 +- .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 2 +- .../BlueprintBaseName.1.Tests.csproj | 2 +- .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 2 +- .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 2 +- .../BlueprintBaseName.1.Tests.csproj | 2 +- .../template/test/BlueprintBaseName.1.Tests/FunctionTest.cs | 2 ++ .../src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj | 4 ++-- .../BlueprintBaseName.1.Tests.fsproj | 4 ++-- .../template/test/BlueprintBaseName.1.Tests/Program.fs | 1 - .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 4 ++-- .../BlueprintBaseName.1.Tests.csproj | 2 +- .../src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj | 6 +++--- .../BlueprintBaseName.1.Tests.fsproj | 6 +++--- .../template/test/BlueprintBaseName.1.Tests/Program.fs | 1 - .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 6 +++--- .../BlueprintBaseName.1.Tests.csproj | 2 +- .../src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj | 6 +++--- .../BlueprintBaseName.1.Tests.fsproj | 4 ++-- .../template/test/BlueprintBaseName.1.Tests/Program.fs | 1 - .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 6 +++--- .../BlueprintBaseName.1.Tests.csproj | 2 +- .../src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj | 2 +- .../BlueprintBaseName.1.Tests.fsproj | 4 ++-- .../template/test/BlueprintBaseName.1.Tests/Program.fs | 1 - .../src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj | 2 +- .../BlueprintBaseName.1.Tests.fsproj | 2 +- .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 2 +- .../BlueprintBaseName.1.Tests.csproj | 2 +- .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 2 +- .../BlueprintBaseName.1.Tests.csproj | 2 +- .../src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj | 2 +- .../BlueprintBaseName.1.Tests.fsproj | 4 ++-- .../template/test/BlueprintBaseName.1.Tests/Program.fs | 1 - .../src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj | 2 +- .../BlueprintBaseName.1.Tests.fsproj | 2 +- .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 4 ++-- .../template/src/BlueprintBaseName.1/serverless.template | 2 +- .../BlueprintBaseName.1.Tests.csproj | 2 +- .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 4 ++-- .../template/src/BlueprintBaseName.1/serverless.template | 2 +- .../BlueprintBaseName.1.Tests.csproj | 2 +- .../src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj | 2 +- .../BlueprintBaseName.1.Tests.fsproj | 4 ++-- .../template/test/BlueprintBaseName.1.Tests/Program.fs | 1 - .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 2 +- .../BlueprintBaseName.1.Tests.csproj | 2 +- .../template/test/BlueprintBaseName.1.Tests/FunctionTest.cs | 3 +++ .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 4 ++-- .../template/src/BlueprintBaseName.1/serverless.template | 2 +- .../src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj | 4 ++-- .../BlueprintBaseName.1.Tests.fsproj | 4 ++-- .../template/test/BlueprintBaseName.1.Tests/Program.fs | 1 - .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 4 ++-- .../BlueprintBaseName.1.Tests.csproj | 2 +- .../src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj | 4 ++-- .../BlueprintBaseName.1.Tests.fsproj | 4 ++-- .../template/test/BlueprintBaseName.1.Tests/Program.fs | 1 - .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 6 +++--- .../template/src/BlueprintBaseName.1/serverless.template | 2 +- .../BlueprintBaseName.1.Tests.csproj | 2 +- .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 2 +- .../BlueprintBaseName.1.Tests.csproj | 2 +- .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 2 +- .../BlueprintBaseName.1.Tests.csproj | 2 +- .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 2 +- .../BlueprintBaseName.1.Tests.csproj | 2 +- .../src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj | 2 +- .../BlueprintBaseName.1.Tests.fsproj | 4 ++-- .../template/test/BlueprintBaseName.1.Tests/Program.fs | 1 - .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 2 +- .../BlueprintBaseName.1.Tests.csproj | 2 +- .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 2 +- .../BlueprintBaseName.1.Tests.csproj | 2 +- .../template/test/BlueprintBaseName.1.Tests/FunctionTest.cs | 3 ++- .../src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj | 2 +- .../BlueprintBaseName.1.Tests.fsproj | 4 ++-- .../template/test/BlueprintBaseName.1.Tests/Program.fs | 1 - .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 2 +- .../BlueprintBaseName.1.Tests.csproj | 2 +- .../src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj | 4 ++-- .../BlueprintBaseName.1.Tests.fsproj | 6 +++--- .../template/test/BlueprintBaseName.1.Tests/Program.fs | 1 - .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 4 ++-- .../BlueprintBaseName.1.Tests.csproj | 4 ++-- .../src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj | 4 ++-- .../BlueprintBaseName.1.Tests.fsproj | 6 +++--- .../template/test/BlueprintBaseName.1.Tests/Program.fs | 1 - .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 4 ++-- .../BlueprintBaseName.1.Tests.csproj | 4 ++-- .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 2 +- .../BlueprintBaseName.1.Tests.csproj | 2 +- .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 2 +- .../BlueprintBaseName.1.Tests.csproj | 2 +- .../src/BlueprintBaseName.1/BlueprintBaseName.1.fsproj | 2 +- .../BlueprintBaseName.1.Tests.fsproj | 4 ++-- .../template/test/BlueprintBaseName.1.Tests/Program.fs | 1 - .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 2 +- .../BlueprintBaseName.1.Tests.csproj | 2 +- Blueprints/BlueprintDefinitions/vs2022/Templates.csproj | 2 +- .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 4 ++-- .../src/BlueprintBaseName.1/BlueprintBaseName.1.csproj | 6 +++--- .../BlueprintBaseName.1.Tests.csproj | 2 +- CHANGELOG.md | 4 ++++ 114 files changed, 153 insertions(+), 158 deletions(-) delete mode 100644 Blueprints/BlueprintDefinitions/vs2022/CustomRuntimeFunction-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs delete mode 100644 Blueprints/BlueprintDefinitions/vs2022/DetectImageLabels-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs delete mode 100644 Blueprints/BlueprintDefinitions/vs2022/DetectImageLabelsServerless-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs delete mode 100644 Blueprints/BlueprintDefinitions/vs2022/EmptyFunction-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs delete mode 100644 Blueprints/BlueprintDefinitions/vs2022/EmptyServerless-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs delete mode 100644 Blueprints/BlueprintDefinitions/vs2022/GiraffeWebApp-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs delete mode 100644 Blueprints/BlueprintDefinitions/vs2022/NativeAOTFunction-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs delete mode 100644 Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs delete mode 100644 Blueprints/BlueprintDefinitions/vs2022/SimpleDynamoDBFunction-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs delete mode 100644 Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFunction-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs delete mode 100644 Blueprints/BlueprintDefinitions/vs2022/SimpleS3Function-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs delete mode 100644 Blueprints/BlueprintDefinitions/vs2022/SimpleS3FunctionServerless-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs delete mode 100644 Blueprints/BlueprintDefinitions/vs2022/StepFunctionsHelloWorld-FSharp/template/test/BlueprintBaseName.1.Tests/Program.fs diff --git a/Blueprints/BlueprintDefinitions/vs2022/AnnotationsFramework/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/AnnotationsFramework/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj index fbff809d8..1889a1e29 100644 --- a/Blueprints/BlueprintDefinitions/vs2022/AnnotationsFramework/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj +++ b/Blueprints/BlueprintDefinitions/vs2022/AnnotationsFramework/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj @@ -12,10 +12,10 @@ true - + - + diff --git a/Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj b/Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj index c15ef3e33..c99cf3ff0 100644 --- a/Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj +++ b/Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj @@ -3,7 +3,7 @@ - netstandard2.0;net5.0;net6.0;net8.0 + netstandard2.0;net6.0;net8.0;net9.0 1.12.1 Provides a bootstrap and Lambda Runtime API Client to help you to develop custom .NET Core Lambda Runtimes. Amazon.Lambda.RuntimeSupport @@ -20,7 +20,7 @@ Exe - + IL2026,IL2067,IL2075 true true @@ -41,7 +41,7 @@ - + diff --git a/Libraries/src/SnapshotRestore.Registry/SnapshotRestore.Registry.csproj b/Libraries/src/SnapshotRestore.Registry/SnapshotRestore.Registry.csproj index 049fcf90e..fefd5c2ea 100644 --- a/Libraries/src/SnapshotRestore.Registry/SnapshotRestore.Registry.csproj +++ b/Libraries/src/SnapshotRestore.Registry/SnapshotRestore.Registry.csproj @@ -1,7 +1,9 @@  + + - net8.0 + net8.0;net9.0 1.0.0 Provides a Restore Hooks library to help you register before snapshot and after restore hooks. SnapshotRestore.Registry diff --git a/buildtools/common.props b/buildtools/common.props index f0c4b9113..70fbc9abb 100644 --- a/buildtools/common.props +++ b/buildtools/common.props @@ -13,7 +13,7 @@ https://sdk-for-net.amazonwebservices.com/images/AWSLogo128x128.png https://github.com/aws/aws-lambda-dotnet - http://aws.amazon.com/apache2.0/ + Apache-2.0 false From 526c0bdf9f9132963d644b0309177221cffcdb39 Mon Sep 17 00:00:00 2001 From: Phil Asmar Date: Fri, 29 Nov 2024 14:20:43 -0500 Subject: [PATCH 16/25] chore: update VersionPrefix to Version for AutoVer support --- .../SnapshotRestore.Registry/SnapshotRestore.Registry.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/src/SnapshotRestore.Registry/SnapshotRestore.Registry.csproj b/Libraries/src/SnapshotRestore.Registry/SnapshotRestore.Registry.csproj index fefd5c2ea..2b40be3f2 100644 --- a/Libraries/src/SnapshotRestore.Registry/SnapshotRestore.Registry.csproj +++ b/Libraries/src/SnapshotRestore.Registry/SnapshotRestore.Registry.csproj @@ -4,7 +4,7 @@ net8.0;net9.0 - 1.0.0 + 1.0.0 Provides a Restore Hooks library to help you register before snapshot and after restore hooks. SnapshotRestore.Registry SnapshotRestore.Registry From 9f388d9f535929d21feca3f712d26161eb46e90d Mon Sep 17 00:00:00 2001 From: Phil Asmar Date: Fri, 29 Nov 2024 15:02:43 -0500 Subject: [PATCH 17/25] ci: update release workflow to use .NET 9 --- .github/workflows/create-release-pr.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 4b099ecff..c424d4e5a 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -42,11 +42,11 @@ jobs: with: fetch-depth: '0' token: ${{ env.AWS_SECRET_TOKEN }} - # Install .NET8 which is needed for AutoVer - - name: Setup .NET 8.0 + # Install .NET9 which is needed for AutoVer + - name: Setup .NET 9.0 uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.x + dotnet-version: 9.0.x # Install AutoVer to automate versioning and changelog creation - name: Install AutoVer run: dotnet tool install --global AutoVer --version 0.0.24 From 5e7b3253a10db099c454d59d7f7895cc8c83d5f4 Mon Sep 17 00:00:00 2001 From: Phil Asmar Date: Thu, 5 Dec 2024 09:11:43 -0500 Subject: [PATCH 18/25] chore: add workflow to check if change file is included in a PR --- .github/workflows/change-file-in-pr.yml | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/change-file-in-pr.yml diff --git a/.github/workflows/change-file-in-pr.yml b/.github/workflows/change-file-in-pr.yml new file mode 100644 index 000000000..7204e3101 --- /dev/null +++ b/.github/workflows/change-file-in-pr.yml @@ -0,0 +1,30 @@ +name: Change File Included in PR + +on: + pull_request: + types: [opened, synchronize, reopened, labeled] + +jobs: + check-files-in-directory: + if: ${{ !contains(github.event.pull_request.labels.*.name, 'Release Not Needed') && !contains(github.event.pull_request.labels.*.name, 'Release PR') }} + name: Change File Included in PR + runs-on: ubuntu-latest + + steps: + - name: Checkout PR code + uses: actions/checkout@v3 + + - name: Get List of Changed Files + id: changed-files + uses: tj-actions/changed-files@4edd678ac3f81e2dc578756871e4d00c19191daf #v45 + + - name: Check for Change File(s) in .autover/changes/ + run: | + DIRECTORY=".autover/changes/" + if echo "${{ steps.changed-files.outputs.all_changed_files }}" | grep -q "$DIRECTORY"; then + echo "✅ One or more change files in '$DIRECTORY' are included in this PR." + else + echo "❌ No change files in '$DIRECTORY' are included in this PR." + echo "Refer to the 'Adding a change file to your contribution branch' section of https://github.com/aws/aws-lambda-dotnet/blob/master/CONTRIBUTING.md" + exit 1 + fi From d34a51ff12d30e65dda900ce3916aaf88f9d9c67 Mon Sep 17 00:00:00 2001 From: aws-sdk-dotnet-automation Date: Mon, 9 Dec 2024 15:05:14 +0000 Subject: [PATCH 19/25] release_2024-12-09 --- .../Amazon.Lambda.Annotations.SourceGenerator.csproj | 2 +- .../Amazon.Lambda.Annotations.csproj | 2 +- .../Amazon.Lambda.RuntimeSupport.csproj | 2 +- .../SnapshotRestore.Registry.csproj | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Libraries/src/Amazon.Lambda.Annotations.SourceGenerator/Amazon.Lambda.Annotations.SourceGenerator.csproj b/Libraries/src/Amazon.Lambda.Annotations.SourceGenerator/Amazon.Lambda.Annotations.SourceGenerator.csproj index d240015a0..63892bc04 100644 --- a/Libraries/src/Amazon.Lambda.Annotations.SourceGenerator/Amazon.Lambda.Annotations.SourceGenerator.csproj +++ b/Libraries/src/Amazon.Lambda.Annotations.SourceGenerator/Amazon.Lambda.Annotations.SourceGenerator.csproj @@ -20,7 +20,7 @@ true false - 1.6.1 + 1.6.2 diff --git a/Libraries/src/Amazon.Lambda.Annotations/Amazon.Lambda.Annotations.csproj b/Libraries/src/Amazon.Lambda.Annotations/Amazon.Lambda.Annotations.csproj index 9649188ee..867d89dc3 100644 --- a/Libraries/src/Amazon.Lambda.Annotations/Amazon.Lambda.Annotations.csproj +++ b/Libraries/src/Amazon.Lambda.Annotations/Amazon.Lambda.Annotations.csproj @@ -11,7 +11,7 @@ ..\..\..\buildtools\public.snk true - 1.6.1 + 1.6.2 diff --git a/Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj b/Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj index c99cf3ff0..d052fce7b 100644 --- a/Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj +++ b/Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj @@ -4,7 +4,7 @@ netstandard2.0;net6.0;net8.0;net9.0 - 1.12.1 + 1.12.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 diff --git a/Libraries/src/SnapshotRestore.Registry/SnapshotRestore.Registry.csproj b/Libraries/src/SnapshotRestore.Registry/SnapshotRestore.Registry.csproj index 2b40be3f2..3c7d3f2c0 100644 --- a/Libraries/src/SnapshotRestore.Registry/SnapshotRestore.Registry.csproj +++ b/Libraries/src/SnapshotRestore.Registry/SnapshotRestore.Registry.csproj @@ -1,10 +1,10 @@ - + net8.0;net9.0 - 1.0.0 + 1.0.1 Provides a Restore Hooks library to help you register before snapshot and after restore hooks. SnapshotRestore.Registry SnapshotRestore.Registry @@ -22,6 +22,6 @@ - + From d7d094ed06534e863233b3f6f4d614b5af772d39 Mon Sep 17 00:00:00 2001 From: aws-sdk-dotnet-automation Date: Mon, 9 Dec 2024 15:06:11 +0000 Subject: [PATCH 20/25] Update test app CloudFormation templates --- Libraries/test/TestExecutableServerlessApp/serverless.template | 2 +- Libraries/test/TestServerlessApp.NET8/serverless.template | 2 +- Libraries/test/TestServerlessApp/serverless.template | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Libraries/test/TestExecutableServerlessApp/serverless.template b/Libraries/test/TestExecutableServerlessApp/serverless.template index a7b5e3bb4..951772fa9 100644 --- a/Libraries/test/TestExecutableServerlessApp/serverless.template +++ b/Libraries/test/TestExecutableServerlessApp/serverless.template @@ -1,7 +1,7 @@ { "AWSTemplateFormatVersion": "2010-09-09", "Transform": "AWS::Serverless-2016-10-31", - "Description": "An AWS Serverless Application. This template is partially managed by Amazon.Lambda.Annotations (v1.6.1.0).", + "Description": "An AWS Serverless Application. This template is partially managed by Amazon.Lambda.Annotations (v1.6.2.0).", "Parameters": { "ArchitectureTypeParameter": { "Type": "String", diff --git a/Libraries/test/TestServerlessApp.NET8/serverless.template b/Libraries/test/TestServerlessApp.NET8/serverless.template index 1d1e21c3c..914646a9d 100644 --- a/Libraries/test/TestServerlessApp.NET8/serverless.template +++ b/Libraries/test/TestServerlessApp.NET8/serverless.template @@ -1,7 +1,7 @@ { "AWSTemplateFormatVersion": "2010-09-09", "Transform": "AWS::Serverless-2016-10-31", - "Description": "This template is partially managed by Amazon.Lambda.Annotations (v1.6.1.0).", + "Description": "This template is partially managed by Amazon.Lambda.Annotations (v1.6.2.0).", "Resources": { "TestServerlessAppNET8FunctionsToUpperGenerated": { "Type": "AWS::Serverless::Function", diff --git a/Libraries/test/TestServerlessApp/serverless.template b/Libraries/test/TestServerlessApp/serverless.template index 26f98e4da..34dbe2b3b 100644 --- a/Libraries/test/TestServerlessApp/serverless.template +++ b/Libraries/test/TestServerlessApp/serverless.template @@ -1,7 +1,7 @@ { "AWSTemplateFormatVersion": "2010-09-09", "Transform": "AWS::Serverless-2016-10-31", - "Description": "An AWS Serverless Application. This template is partially managed by Amazon.Lambda.Annotations (v1.6.1.0).", + "Description": "An AWS Serverless Application. This template is partially managed by Amazon.Lambda.Annotations (v1.6.2.0).", "Parameters": { "ArchitectureTypeParameter": { "Type": "String", From 3596a58ac6d532695745866a7157896a63f6979c Mon Sep 17 00:00:00 2001 From: aws-sdk-dotnet-automation Date: Mon, 9 Dec 2024 15:06:13 +0000 Subject: [PATCH 21/25] Updated changelog --- .../changes/2685eba0-7e2e-4bb7-aa6c-4a237434d388.json | 11 ----------- .../changes/27878e75-1d65-4334-b3cc-fb79a84f9456.json | 11 ----------- .../changes/40379e2a-29d6-4e86-a7c8-af98eacf5dd9.json | 11 ----------- .../changes/b9c57497-1ab4-4d26-8cc6-6aa945f7ac96.json | 11 ----------- CHANGELOG.md | 10 ++++++++++ 5 files changed, 10 insertions(+), 44 deletions(-) delete mode 100644 .autover/changes/2685eba0-7e2e-4bb7-aa6c-4a237434d388.json delete mode 100644 .autover/changes/27878e75-1d65-4334-b3cc-fb79a84f9456.json delete mode 100644 .autover/changes/40379e2a-29d6-4e86-a7c8-af98eacf5dd9.json delete mode 100644 .autover/changes/b9c57497-1ab4-4d26-8cc6-6aa945f7ac96.json diff --git a/.autover/changes/2685eba0-7e2e-4bb7-aa6c-4a237434d388.json b/.autover/changes/2685eba0-7e2e-4bb7-aa6c-4a237434d388.json deleted file mode 100644 index 5ab99c476..000000000 --- a/.autover/changes/2685eba0-7e2e-4bb7-aa6c-4a237434d388.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "Projects": [ - { - "Name": "SnapshotRestore.Registry", - "Type": "Patch", - "ChangelogMessages": [ - "Added License URL to project" - ] - } - ] -} \ No newline at end of file diff --git a/.autover/changes/27878e75-1d65-4334-b3cc-fb79a84f9456.json b/.autover/changes/27878e75-1d65-4334-b3cc-fb79a84f9456.json deleted file mode 100644 index cfbbed4f9..000000000 --- a/.autover/changes/27878e75-1d65-4334-b3cc-fb79a84f9456.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "Projects": [ - { - "Name": "Amazon.Lambda.RuntimeSupport", - "Type": "Patch", - "ChangelogMessages": [ - "Updated project to support building the .NET 9 Lambda custom runtime image" - ] - } - ] -} \ No newline at end of file diff --git a/.autover/changes/40379e2a-29d6-4e86-a7c8-af98eacf5dd9.json b/.autover/changes/40379e2a-29d6-4e86-a7c8-af98eacf5dd9.json deleted file mode 100644 index 3e568add4..000000000 --- a/.autover/changes/40379e2a-29d6-4e86-a7c8-af98eacf5dd9.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "Projects": [ - { - "Name": "Amazon.Lambda.Annotations", - "Type": "Patch", - "ChangelogMessages": [ - "Added License URL to project" - ] - } - ] -} \ No newline at end of file diff --git a/.autover/changes/b9c57497-1ab4-4d26-8cc6-6aa945f7ac96.json b/.autover/changes/b9c57497-1ab4-4d26-8cc6-6aa945f7ac96.json deleted file mode 100644 index e8b42a71f..000000000 --- a/.autover/changes/b9c57497-1ab4-4d26-8cc6-6aa945f7ac96.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "Projects": [ - { - "Name": "SnapshotRestore.Registry", - "Type": "Patch", - "ChangelogMessages": [ - "Updated project to support building the .NET 9 Lambda custom runtime image" - ] - } - ] -} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b3e13622..f5254fa89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## Release 2024-12-09 + +### SnapshotRestore.Registry (1.0.1) +* Added License URL to project +* Updated project to support building the .NET 9 Lambda custom runtime image +### Amazon.Lambda.RuntimeSupport (1.12.2) +* Updated project to support building the .NET 9 Lambda custom runtime image +### Amazon.Lambda.Annotations (1.6.2) +* Added License URL to project + ## Release 2024-11-26 ### Amazon.Lambda.AspNetCoreServer (9.0.3) From 982003fc45594748c82239c16e84d0fb0b2fda89 Mon Sep 17 00:00:00 2001 From: Philippe El Asmar <53088140+philasmar@users.noreply.github.com> Date: Wed, 11 Dec 2024 20:00:10 -0500 Subject: [PATCH 22/25] Add missing SnapshotRestore.Registry package to container images (#1904) --- LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile | 1 + LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile | 1 + LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile | 1 + LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile | 1 + 4 files changed, 4 insertions(+) diff --git a/LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile index 9c498135b..a5aec10c8 100644 --- a/LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile @@ -30,6 +30,7 @@ RUN curl -SL --output aspnetcore.tar.gz https://dotnetcli.azureedge.net/dotnet/a FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim AS builder WORKDIR /src COPY ["Libraries/src/Amazon.Lambda.RuntimeSupport", "Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/"] +COPY ["Libraries/src/SnapshotRestore.Registry", "Repo/Libraries/src/SnapshotRestore.Registry/"] COPY ["Libraries/src/Amazon.Lambda.Core", "Repo/Libraries/src/Amazon.Lambda.Core/"] COPY ["Libraries/src/SnapshotRestore.Registry", "Repo/Libraries/src/SnapshotRestore.Registry/"] COPY ["buildtools/", "Repo/buildtools/"] diff --git a/LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile index 60c2309f8..b5b0a0d51 100644 --- a/LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile @@ -30,6 +30,7 @@ RUN curl -SL --output aspnetcore.tar.gz https://dotnetcli.azureedge.net/dotnet/a FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim AS builder WORKDIR /src COPY ["Libraries/src/Amazon.Lambda.RuntimeSupport", "Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/"] +COPY ["Libraries/src/SnapshotRestore.Registry", "Repo/Libraries/src/SnapshotRestore.Registry/"] COPY ["Libraries/src/Amazon.Lambda.Core", "Repo/Libraries/src/Amazon.Lambda.Core/"] COPY ["Libraries/src/SnapshotRestore.Registry", "Repo/Libraries/src/SnapshotRestore.Registry/"] COPY ["buildtools/", "Repo/buildtools/"] diff --git a/LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile index 7b35c22de..7c52053a8 100644 --- a/LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile @@ -30,6 +30,7 @@ RUN curl -SL --output aspnetcore.tar.gz https://dotnetcli.azureedge.net/dotnet/a FROM mcr.microsoft.com/dotnet/sdk:9.0-bookworm-slim AS builder WORKDIR /src COPY ["Libraries/src/Amazon.Lambda.RuntimeSupport", "Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/"] +COPY ["Libraries/src/SnapshotRestore.Registry", "Repo/Libraries/src/SnapshotRestore.Registry/"] COPY ["Libraries/src/Amazon.Lambda.Core", "Repo/Libraries/src/Amazon.Lambda.Core/"] COPY ["buildtools/", "Repo/buildtools/"] RUN dotnet restore "Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj" /p:TargetFrameworks=net9.0 diff --git a/LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile index 89f7512eb..ba29bbe02 100644 --- a/LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile @@ -30,6 +30,7 @@ RUN curl -SL --output aspnetcore.tar.gz https://dotnetcli.azureedge.net/dotnet/a FROM mcr.microsoft.com/dotnet/sdk:9.0-bookworm-slim AS builder WORKDIR /src COPY ["Libraries/src/Amazon.Lambda.RuntimeSupport", "Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/"] +COPY ["Libraries/src/SnapshotRestore.Registry", "Repo/Libraries/src/SnapshotRestore.Registry/"] COPY ["Libraries/src/Amazon.Lambda.Core", "Repo/Libraries/src/Amazon.Lambda.Core/"] COPY ["buildtools/", "Repo/buildtools/"] RUN dotnet restore "Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj" /p:TargetFrameworks=net9.0 From 0b6033aab66ee5746d03b2222699c5b3f671a3de Mon Sep 17 00:00:00 2001 From: Phil Asmar Date: Wed, 11 Dec 2024 20:23:41 -0500 Subject: [PATCH 23/25] chore: update lambda dockerfile workflow to support .NET 9 --- .github/workflows/update-Dockerfiles.yml | 62 ++++++++++++------------ 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/.github/workflows/update-Dockerfiles.yml b/.github/workflows/update-Dockerfiles.yml index 37297cbd6..f45d23a23 100644 --- a/.github/workflows/update-Dockerfiles.yml +++ b/.github/workflows/update-Dockerfiles.yml @@ -18,32 +18,32 @@ on: description: ".NET 6 Next Version" type: string required: true - NET_7_AMD64: - description: ".NET 7 AMD64" + NET_8_AMD64: + description: ".NET 8 AMD64" type: boolean required: true default: "true" - NET_7_ARM64: - description: ".NET 7 ARM64" + NET_8_ARM64: + description: ".NET 8 ARM64" type: boolean required: true default: "true" - NET_7_NEXT_VERSION: - description: ".NET 7 Next Version" + NET_8_NEXT_VERSION: + description: ".NET 8 Next Version" type: string required: true - NET_8_AMD64: - description: ".NET 8 AMD64" + NET_9_AMD64: + description: ".NET 9 AMD64" type: boolean required: true default: "true" - NET_8_ARM64: - description: ".NET 8 ARM64" + NET_9_ARM64: + description: ".NET 9 ARM64" type: boolean required: true default: "true" - NET_8_NEXT_VERSION: - description: ".NET 8 Next Version" + NET_9_NEXT_VERSION: + description: ".NET 9 Next Version" type: string required: true @@ -53,10 +53,10 @@ jobs: env: NET_6_AMD64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net6/amd64/Dockerfile" NET_6_ARM64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net6/arm64/Dockerfile" - NET_7_AMD64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net7/amd64/Dockerfile" - NET_7_ARM64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net7/arm64/Dockerfile" NET_8_AMD64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile" NET_8_ARM64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile" + NET_9_AMD64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile" + NET_9_ARM64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile" # Steps represent a sequence of tasks that will be executed as part of the job steps: @@ -79,20 +79,6 @@ jobs: .\LambdaRuntimeDockerfiles/update-dockerfile.ps1 -DockerfilePath ${{ env.NET_6_ARM64_Dockerfile }} -NextVersion ${{ github.event.inputs.NET_6_NEXT_VERSION }} if: ${{ github.event.inputs.NET_6_ARM64 == 'true' }} - - name: Update .NET 7 AMD64 - id: update-net7-amd64 - shell: pwsh - run: | - .\LambdaRuntimeDockerfiles/update-dockerfile.ps1 -DockerfilePath ${{ env.NET_7_AMD64_Dockerfile }} -NextVersion ${{ github.event.inputs.NET_7_NEXT_VERSION }} - if: ${{ github.event.inputs.NET_7_AMD64 == 'true' }} - - - name: Update .NET 7 ARM64 - id: update-net7-arm64 - shell: pwsh - run: | - .\LambdaRuntimeDockerfiles/update-dockerfile.ps1 -DockerfilePath ${{ env.NET_7_ARM64_Dockerfile }} -NextVersion ${{ github.event.inputs.NET_7_NEXT_VERSION }} - if: ${{ github.event.inputs.NET_7_ARM64 == 'true' }} - - name: Update .NET 8 AMD64 id: update-net8-amd64 shell: pwsh @@ -107,6 +93,20 @@ jobs: .\LambdaRuntimeDockerfiles/update-dockerfile.ps1 -DockerfilePath ${{ env.NET_8_ARM64_Dockerfile }} -NextVersion ${{ github.event.inputs.NET_8_NEXT_VERSION }} if: ${{ github.event.inputs.NET_8_ARM64 == 'true' }} + - name: Update .NET 9 AMD64 + id: update-net9-amd64 + shell: pwsh + run: | + .\LambdaRuntimeDockerfiles/update-dockerfile.ps1 -DockerfilePath ${{ env.NET_9_AMD64_Dockerfile }} -NextVersion ${{ github.event.inputs.NET_9_NEXT_VERSION }} + if: ${{ github.event.inputs.NET_9_AMD64 == 'true' }} + + - name: Update .NET 9 ARM64 + id: update-net9-arm64 + shell: pwsh + run: | + .\LambdaRuntimeDockerfiles/update-dockerfile.ps1 -DockerfilePath ${{ env.NET_9_ARM64_Dockerfile }} -NextVersion ${{ github.event.inputs.NET_9_NEXT_VERSION }} + if: ${{ github.event.inputs.NET_9_ARM64 == 'true' }} + # Update Dockerfiles if newer version of ASP.NET Core is available - name: Commit and Push id: commit-push @@ -140,10 +140,10 @@ jobs: '{0}\n{1}\n{2}\n{3}\n{4}\n{5}', join(steps.update-net6-amd64.outputs.MESSAGE, '\n'), join(steps.update-net6-arm64.outputs.MESSAGE, '\n'), - join(steps.update-net7-amd64.outputs.MESSAGE, '\n'), - join(steps.update-net7-arm64.outputs.MESSAGE, '\n'), join(steps.update-net8-amd64.outputs.MESSAGE, '\n'), - join(steps.update-net8-arm64.outputs.MESSAGE, '\n') + join(steps.update-net8-arm64.outputs.MESSAGE, '\n'), + join(steps.update-net9-amd64.outputs.MESSAGE, '\n'), + join(steps.update-net9-arm64.outputs.MESSAGE, '\n') ) }}" github_token: ${{ secrets.GITHUB_TOKEN }} From 4449baad540b6f2eba4e1823ded9aa819533d135 Mon Sep 17 00:00:00 2001 From: Phil Asmar Date: Thu, 19 Dec 2024 14:53:36 -0500 Subject: [PATCH 24/25] address semgrep finding --- .github/workflows/update-Dockerfiles.yml | 30 +++++++++++++++++++----- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/.github/workflows/update-Dockerfiles.yml b/.github/workflows/update-Dockerfiles.yml index f45d23a23..c2533a836 100644 --- a/.github/workflows/update-Dockerfiles.yml +++ b/.github/workflows/update-Dockerfiles.yml @@ -68,43 +68,61 @@ jobs: - name: Update .NET 6 AMD64 id: update-net6-amd64 shell: pwsh + env: + DOCKERFILE_PATH: ${{ env.NET_6_AMD64_Dockerfile }} + NEXT_VERSION: ${{ github.event.inputs.NET_6_NEXT_VERSION }} run: | - .\LambdaRuntimeDockerfiles/update-dockerfile.ps1 -DockerfilePath ${{ env.NET_6_AMD64_Dockerfile }} -NextVersion ${{ github.event.inputs.NET_6_NEXT_VERSION }} + .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "$DOCKERFILE_PATH" -NextVersion "$NEXT_VERSION" if: ${{ github.event.inputs.NET_6_AMD64 == 'true' }} - name: Update .NET 6 ARM64 id: update-net6-arm64 shell: pwsh + env: + DOCKERFILE_PATH: ${{ env.NET_6_ARM64_Dockerfile }} + NEXT_VERSION: ${{ github.event.inputs.NET_6_NEXT_VERSION }} run: | - .\LambdaRuntimeDockerfiles/update-dockerfile.ps1 -DockerfilePath ${{ env.NET_6_ARM64_Dockerfile }} -NextVersion ${{ github.event.inputs.NET_6_NEXT_VERSION }} + .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "$DOCKERFILE_PATH" -NextVersion "$NEXT_VERSION" if: ${{ github.event.inputs.NET_6_ARM64 == 'true' }} - name: Update .NET 8 AMD64 id: update-net8-amd64 shell: pwsh + env: + DOCKERFILE_PATH: ${{ env.NET_8_AMD64_Dockerfile }} + NEXT_VERSION: ${{ github.event.inputs.NET_8_NEXT_VERSION }} run: | - .\LambdaRuntimeDockerfiles/update-dockerfile.ps1 -DockerfilePath ${{ env.NET_8_AMD64_Dockerfile }} -NextVersion ${{ github.event.inputs.NET_8_NEXT_VERSION }} + .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "$DOCKERFILE_PATH" -NextVersion "$NEXT_VERSION" if: ${{ github.event.inputs.NET_8_AMD64 == 'true' }} - name: Update .NET 8 ARM64 id: update-net8-arm64 shell: pwsh + env: + DOCKERFILE_PATH: ${{ env.NET_8_ARM64_Dockerfile }} + NEXT_VERSION: ${{ github.event.inputs.NET_8_NEXT_VERSION }} run: | - .\LambdaRuntimeDockerfiles/update-dockerfile.ps1 -DockerfilePath ${{ env.NET_8_ARM64_Dockerfile }} -NextVersion ${{ github.event.inputs.NET_8_NEXT_VERSION }} + .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "$DOCKERFILE_PATH" -NextVersion "$NEXT_VERSION" if: ${{ github.event.inputs.NET_8_ARM64 == 'true' }} - name: Update .NET 9 AMD64 id: update-net9-amd64 shell: pwsh + env: + DOCKERFILE_PATH: ${{ env.NET_9_AMD64_Dockerfile }} + NEXT_VERSION: ${{ github.event.inputs.NET_9_NEXT_VERSION }} run: | - .\LambdaRuntimeDockerfiles/update-dockerfile.ps1 -DockerfilePath ${{ env.NET_9_AMD64_Dockerfile }} -NextVersion ${{ github.event.inputs.NET_9_NEXT_VERSION }} + .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "$DOCKERFILE_PATH" -NextVersion "$NEXT_VERSION" if: ${{ github.event.inputs.NET_9_AMD64 == 'true' }} - name: Update .NET 9 ARM64 id: update-net9-arm64 shell: pwsh + env: + DOCKERFILE_PATH: ${{ env.NET_9_ARM64_Dockerfile }} + NEXT_VERSION: ${{ github.event.inputs.NET_9_NEXT_VERSION }} run: | - .\LambdaRuntimeDockerfiles/update-dockerfile.ps1 -DockerfilePath ${{ env.NET_9_ARM64_Dockerfile }} -NextVersion ${{ github.event.inputs.NET_9_NEXT_VERSION }} + .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "$DOCKERFILE_PATH" -NextVersion "$NEXT_VERSION" if: ${{ github.event.inputs.NET_9_ARM64 == 'true' }} # Update Dockerfiles if newer version of ASP.NET Core is available From 5e876d3b54dfb43eea4e195295d25791bdc21b82 Mon Sep 17 00:00:00 2001 From: Phil Asmar Date: Thu, 16 Jan 2025 10:28:54 -0500 Subject: [PATCH 25/25] chore: fix issue with env var not being passed to powershell script --- .github/workflows/update-Dockerfiles.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/update-Dockerfiles.yml b/.github/workflows/update-Dockerfiles.yml index c2533a836..cd538982b 100644 --- a/.github/workflows/update-Dockerfiles.yml +++ b/.github/workflows/update-Dockerfiles.yml @@ -72,7 +72,7 @@ jobs: DOCKERFILE_PATH: ${{ env.NET_6_AMD64_Dockerfile }} NEXT_VERSION: ${{ github.event.inputs.NET_6_NEXT_VERSION }} run: | - .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "$DOCKERFILE_PATH" -NextVersion "$NEXT_VERSION" + .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}" if: ${{ github.event.inputs.NET_6_AMD64 == 'true' }} - name: Update .NET 6 ARM64 @@ -82,7 +82,7 @@ jobs: DOCKERFILE_PATH: ${{ env.NET_6_ARM64_Dockerfile }} NEXT_VERSION: ${{ github.event.inputs.NET_6_NEXT_VERSION }} run: | - .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "$DOCKERFILE_PATH" -NextVersion "$NEXT_VERSION" + .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}" if: ${{ github.event.inputs.NET_6_ARM64 == 'true' }} - name: Update .NET 8 AMD64 @@ -92,7 +92,7 @@ jobs: DOCKERFILE_PATH: ${{ env.NET_8_AMD64_Dockerfile }} NEXT_VERSION: ${{ github.event.inputs.NET_8_NEXT_VERSION }} run: | - .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "$DOCKERFILE_PATH" -NextVersion "$NEXT_VERSION" + .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}" if: ${{ github.event.inputs.NET_8_AMD64 == 'true' }} - name: Update .NET 8 ARM64 @@ -102,7 +102,7 @@ jobs: DOCKERFILE_PATH: ${{ env.NET_8_ARM64_Dockerfile }} NEXT_VERSION: ${{ github.event.inputs.NET_8_NEXT_VERSION }} run: | - .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "$DOCKERFILE_PATH" -NextVersion "$NEXT_VERSION" + .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}" if: ${{ github.event.inputs.NET_8_ARM64 == 'true' }} - name: Update .NET 9 AMD64 @@ -112,7 +112,7 @@ jobs: DOCKERFILE_PATH: ${{ env.NET_9_AMD64_Dockerfile }} NEXT_VERSION: ${{ github.event.inputs.NET_9_NEXT_VERSION }} run: | - .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "$DOCKERFILE_PATH" -NextVersion "$NEXT_VERSION" + .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}" if: ${{ github.event.inputs.NET_9_AMD64 == 'true' }} - name: Update .NET 9 ARM64 @@ -122,7 +122,7 @@ jobs: DOCKERFILE_PATH: ${{ env.NET_9_ARM64_Dockerfile }} NEXT_VERSION: ${{ github.event.inputs.NET_9_NEXT_VERSION }} run: | - .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "$DOCKERFILE_PATH" -NextVersion "$NEXT_VERSION" + .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}" if: ${{ github.event.inputs.NET_9_ARM64 == 'true' }} # Update Dockerfiles if newer version of ASP.NET Core is available @@ -166,3 +166,4 @@ jobs: }}" github_token: ${{ secrets.GITHUB_TOKEN }} pr_label: "auto-pr" + \ No newline at end of file