diff --git a/.autover/autover.json b/.autover/autover.json
index 446a27d0a..a5257a79d 100644
--- a/.autover/autover.json
+++ b/.autover/autover.json
@@ -127,6 +127,14 @@
"Tools/LambdaTestTool/src/Amazon.Lambda.TestTool.BlazorTester/Amazon.Lambda.TestTool.BlazorTester80-pack.csproj",
"Tools/LambdaTestTool/src/Amazon.Lambda.TestTool.BlazorTester/Amazon.Lambda.TestTool.BlazorTester90-pack.csproj"
]
+ },
+ {
+ "Name": "Amazon.Lambda.Templates",
+ "Path": "Blueprints/BlueprintDefinitions/vs2022/Templates.csproj"
+ },
+ {
+ "Name": "SnapshotRestore.Registry",
+ "Path": "Libraries/src/SnapshotRestore.Registry/SnapshotRestore.Registry.csproj"
}
],
"UseCommitsForChangelog": false,
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/.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
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
diff --git a/.github/workflows/update-Dockerfiles.yml b/.github/workflows/update-Dockerfiles.yml
index 37297cbd6..cd538982b 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:
@@ -68,45 +68,63 @@ 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 "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.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 "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.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
+ 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 "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.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 "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.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.DOCKERFILE_PATH }}" -NextVersion "${{ env.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.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
- name: Commit and Push
id: commit-push
@@ -140,11 +158,12 @@ 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 }}
pr_label: "auto-pr"
+
\ No newline at end of file
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/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..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
-
-
-
-
+
+
+
+
@@ -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..d72f9a5ae 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
+ true
-
+
-
-
-
+
+
+
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/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..04742b38a 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..9b8a24663 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..c1c3eb1b3 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..0f010e00b 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
@@ -3,6 +3,7 @@
Library
false
net8.0
+ true
@@ -10,13 +11,13 @@
-
+
-
+
-
-
-
+
+
+
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/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabels/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj
index 3252bbf26..a4fb74d8b 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..2eaf1b1d8 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..0fb0f08eb 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..0f010e00b 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
@@ -3,6 +3,7 @@
Library
false
net8.0
+ true
@@ -10,13 +11,13 @@
-
+
-
+
-
-
-
+
+
+
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/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/DetectImageLabelsServerless/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj
index 3252bbf26..a4fb74d8b 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..2eaf1b1d8 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..47636ed37 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..77114cfba 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
@@ -3,16 +3,17 @@
Library
false
net8.0
+ true
-
+
-
-
-
+
+
+
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-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..dcfdf0515 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..2b9dd0114 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..8aa3178a3 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..31966e20b 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..8aa3178a3 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..31966e20b 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..6ea1cc20e 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..06dbcb51e 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
@@ -3,17 +3,18 @@
Library
false
net8.0
+ true
-
+
-
-
-
-
+
+
+
+
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-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..cfe421d51 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..64484776c 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..8686f501f 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..493702de1 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.1.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..e84091c4c 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..8686f501f 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..5195f7fbc 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.1.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..e84091c4c 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..08a28f548 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..14325d45e 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
@@ -4,6 +4,7 @@
false
net8.0
False
+ true
@@ -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/LexBookTripSample/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/LexBookTripSample/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj
index 7d864e3b4..4cdf110e4 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..d4231df86 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/LexBookTripSample/template/test/BlueprintBaseName.1.Tests/FunctionTest.cs b/Blueprints/BlueprintDefinitions/vs2022/LexBookTripSample/template/test/BlueprintBaseName.1.Tests/FunctionTest.cs
index a60ad4495..fb33bd859 100644
--- a/Blueprints/BlueprintDefinitions/vs2022/LexBookTripSample/template/test/BlueprintBaseName.1.Tests/FunctionTest.cs
+++ b/Blueprints/BlueprintDefinitions/vs2022/LexBookTripSample/template/test/BlueprintBaseName.1.Tests/FunctionTest.cs
@@ -15,6 +15,7 @@ public void StartBookACarEventTest()
var json = File.ReadAllText("start-book-a-car-event.json");
var lexEvent = JsonConvert.DeserializeObject(json);
+ Assert.NotNull(lexEvent);
var function = new Function();
var context = new TestLambdaContext();
@@ -29,6 +30,7 @@ public void DriverAgeTooYoungEventTest()
var json = File.ReadAllText("driver-age-too-young.json");
var lexEvent = JsonConvert.DeserializeObject(json);
+ Assert.NotNull(lexEvent);
var function = new Function();
var context = new TestLambdaContext();
@@ -46,6 +48,7 @@ public void CommitBookACarEventTest()
var json = File.ReadAllText("commit-book-a-car.json");
var lexEvent = JsonConvert.DeserializeObject(json);
+ Assert.NotNull(lexEvent);
var function = new Function();
var context = new TestLambdaContext();
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..17a2430cb 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..81d94c75d 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.1.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..41d658921 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..77114cfba 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
@@ -3,16 +3,17 @@
Library
false
net8.0
+ true
-
+
-
-
-
+
+
+
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/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/NativeAOTFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj
index 717aa47b1..dfaebdd85 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..31966e20b 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..2aa790508 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..77114cfba 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
@@ -3,16 +3,17 @@
Library
false
net8.0
+ true
-
+
-
-
-
+
+
+
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/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/NativeAOTServerless/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj
index 3503ff027..721ff855b 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..dcf11431a 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.1.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..31966e20b 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..0fa9182f5 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..31966e20b 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..830429680 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..e84091c4c 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..800fce53e 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..31966e20b 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..3ed938a4c 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..d8c2ff060 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
@@ -3,14 +3,15 @@
Library
false
net8.0
+ true
-
+
-
-
-
-
+
+
+
+
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/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/SimpleDynamoDBFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj
index 311dc67af..faa594374 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..9b3e124ce 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..a78dc9622 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..9163ee683 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/SimpleKinesisFirehoseFunction/template/test/BlueprintBaseName.1.Tests/FunctionTest.cs b/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFirehoseFunction/template/test/BlueprintBaseName.1.Tests/FunctionTest.cs
index 5d85e8ba8..0a987d5c0 100644
--- a/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFirehoseFunction/template/test/BlueprintBaseName.1.Tests/FunctionTest.cs
+++ b/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFirehoseFunction/template/test/BlueprintBaseName.1.Tests/FunctionTest.cs
@@ -20,12 +20,13 @@ public void TestKinesisFirehoseEvent()
var json = File.ReadAllText("sample-event.json");
var kinesisEvent = JsonConvert.DeserializeObject(json);
+ Assert.NotNull(kinesisEvent);
var function = new Function();
var context = new TestLambdaContext();
var kinesisResponse = function.FunctionHandler(kinesisEvent, context);
- Assert.Equal(1, kinesisResponse.Records.Count);
+ Assert.Single(kinesisResponse.Records);
Assert.Equal("49572672223665514422805246926656954630972486059535892482", kinesisResponse.Records[0].RecordId);
Assert.Equal(KinesisFirehoseResponse.TRANSFORMED_STATE_OK, kinesisResponse.Records[0].Result);
Assert.Equal("SEVMTE8gV09STEQ=", kinesisResponse.Records[0].Base64EncodedData);
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..2df0ff6ef 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..92526af27 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
@@ -3,14 +3,15 @@
Library
false
net8.0
+ true
-
+
-
-
-
+
+
+
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/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/SimpleKinesisFunction/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj
index f057c79d0..709a3f201 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..473484f97 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..90a55fe3a 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..b366d2ad3 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
@@ -3,15 +3,16 @@
Library
false
net8.0
+ true
-
+
-
-
-
-
+
+
+
+
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/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/SimpleS3Function/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj
index aaf3665eb..3c5789cba 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..0cfc16d59 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..192cd31fc 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..b366d2ad3 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
@@ -3,15 +3,16 @@
Library
false
net8.0
+ true
-
+
-
-
-
-
+
+
+
+
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/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/SimpleS3FunctionServerless/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj
index aaf3665eb..3c5789cba 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..28fc1b865 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..b014ddaf6 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..94ac6185e 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..846cd3ac0 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..94ac6185e 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..62876bc55 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..212e60b08 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
@@ -3,13 +3,14 @@
Library
false
net8.0
+ true
-
+
-
-
-
+
+
+
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/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj b/Blueprints/BlueprintDefinitions/vs2022/StepFunctionsHelloWorld/template/src/BlueprintBaseName.1/BlueprintBaseName.1.csproj
index 3d15b45fe..8aa3178a3 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..31966e20b 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..404ef8199 100644
--- a/Blueprints/BlueprintDefinitions/vs2022/Templates.csproj
+++ b/Blueprints/BlueprintDefinitions/vs2022/Templates.csproj
@@ -2,7 +2,7 @@
Template
- 7.2.1
+ 7.4.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..0d2854066 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..08057c3e3 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..f8696bf9a 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..f5254fa89 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,64 @@
+## 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)
+* Fixed issue '(EmptyBodyBehavior = EmptyBodyBehavior.Allow)' not being honored when request body was empty
+### Amazon.Lambda.RuntimeSupport (1.12.1)
+* Revert behavior for non SnapShot scenario to throw an exception when initialization fails
+### Amazon.Lambda.AspNetCoreServer.Hosting (1.7.3)
+* Fixed issue '(EmptyBodyBehavior = EmptyBodyBehavior.Allow)' not being honored when request body was empty
+
+## Release 2024-11-25
+
+### Amazon.Lambda.Templates (7.4.0)
+* Update package dependencies. The significant dependency update was for Amazon.Lambda.Core and Amazon.Lambda.RuntimeSupport with added support for Lambda SnapStart.
+
+## 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)
+* 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)
+* 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)
+* 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)
diff --git a/LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile
index 3ccc3b915..a5aec10c8 100644
--- a/LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile
+++ b/LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile
@@ -30,7 +30,9 @@ 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/"]
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..b5b0a0d51 100644
--- a/LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile
+++ b/LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile
@@ -30,7 +30,9 @@ 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/"]
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/net9/amd64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile
index 1720840be..7c52053a8 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
@@ -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 4857566a8..ba29bbe02 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
@@ -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/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.Annotations.SourceGenerator/Amazon.Lambda.Annotations.SourceGenerator.csproj b/Libraries/src/Amazon.Lambda.Annotations.SourceGenerator/Amazon.Lambda.Annotations.SourceGenerator.csproj
index 8762d6244..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
@@ -1,4 +1,4 @@
-
+
netstandard2.0;net6.0;net8.0
@@ -9,6 +9,7 @@
https://github.com/aws/aws-lambda-dotnet
images\icon.png
docs\README.md
+ Apache-2.0
@@ -19,7 +20,7 @@
true
false
- 1.6.0
+ 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 348c49695..867d89dc3 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.2
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..2275c405d 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.3
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..3c4e5298b 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.3
Amazon.Lambda.AspNetCoreServer
Amazon.Lambda.AspNetCoreServer
AWS;Amazon;Lambda;aspnetcore
diff --git a/Libraries/src/Amazon.Lambda.AspNetCoreServer/Internal/InvokeFeatures.cs b/Libraries/src/Amazon.Lambda.AspNetCoreServer/Internal/InvokeFeatures.cs
index 293f26b6a..c10da003b 100644
--- a/Libraries/src/Amazon.Lambda.AspNetCoreServer/Internal/InvokeFeatures.cs
+++ b/Libraries/src/Amazon.Lambda.AspNetCoreServer/Internal/InvokeFeatures.cs
@@ -392,7 +392,7 @@ bool IHttpRequestBodyDetectionFeature.CanHaveBody
get
{
var requestFeature = (IHttpRequestFeature)this;
- return requestFeature.Body != null;
+ return requestFeature.Body != null && requestFeature.Body.Length > 0;
}
}
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.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/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj b/Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj
index bf1a5cf34..d052fce7b 100644
--- a/Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj
+++ b/Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj
@@ -1,10 +1,10 @@
-
+
- netstandard2.0;net5.0;net6.0;net8.0
- 1.11.0
+ netstandard2.0;net6.0;net8.0;net9.0
+ 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
@@ -20,7 +20,7 @@
Exe
-
+
IL2026,IL2067,IL2075
true
true
@@ -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..e0ac20907 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,6 +213,12 @@ internal async Task InitializeAsync()
{
WriteUnhandledExceptionToLog(exception);
await Client.ReportInitializationErrorAsync(exception);
+#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
throw;
}
}
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..3c7d3f2c0
--- /dev/null
+++ b/Libraries/src/SnapshotRestore.Registry/SnapshotRestore.Registry.csproj
@@ -0,0 +1,27 @@
+
+
+
+
+
+ net8.0;net9.0
+ 1.0.1
+ 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.AspNetCoreServer.Test/TestCallingWebAPI.cs b/Libraries/test/Amazon.Lambda.AspNetCoreServer.Test/TestCallingWebAPI.cs
index 658bd7f9b..8dd665967 100644
--- a/Libraries/test/Amazon.Lambda.AspNetCoreServer.Test/TestCallingWebAPI.cs
+++ b/Libraries/test/Amazon.Lambda.AspNetCoreServer.Test/TestCallingWebAPI.cs
@@ -126,6 +126,15 @@ public async Task TestPutWithBody()
Assert.Equal("text/plain; charset=utf-8", response.MultiValueHeaders["Content-Type"][0]);
}
+ [Fact]
+ public async Task TestPutNoBody()
+ {
+ var response = await this.InvokeAPIGatewayRequest("values-put-no-body-request.json");
+
+ Assert.Equal(string.Empty, response.Body);
+ Assert.Equal(202, response.StatusCode);
+ }
+
[Fact]
public async Task TestDefaultResponseErrorCode()
{
diff --git a/Libraries/test/Amazon.Lambda.AspNetCoreServer.Test/values-put-no-body-request.json b/Libraries/test/Amazon.Lambda.AspNetCoreServer.Test/values-put-no-body-request.json
new file mode 100644
index 000000000..9877ae200
--- /dev/null
+++ b/Libraries/test/Amazon.Lambda.AspNetCoreServer.Test/values-put-no-body-request.json
@@ -0,0 +1,65 @@
+{
+ "resource": "/{proxy+}",
+ "path": "/api/values/no-body",
+ "httpMethod": "PUT",
+ "headers": {
+ "Accept": "*/*",
+ "Accept-Encoding": "gzip, deflate, br",
+ "CloudFront-Forwarded-Proto": "https",
+ "CloudFront-Is-Desktop-Viewer": "true",
+ "CloudFront-Is-Mobile-Viewer": "false",
+ "CloudFront-Is-SmartTV-Viewer": "false",
+ "CloudFront-Is-Tablet-Viewer": "false",
+ "CloudFront-Viewer-ASN": "20055",
+ "CloudFront-Viewer-Country": "US",
+ "Host": "example.execute-api.us-west-2.amazonaws.com",
+ "User-Agent": "unittests",
+ "Via": "1.1 3dd55c11c72ef969f5e46a679c8244ba.cloudfront.net (CloudFront)",
+ "X-Amz-Cf-Id": "BA8bXHQfFrXacZsRsTUqvFLc849kUgSURcu8IkPIIadtNO2k6gMbtg==",
+ "X-Amzn-Trace-Id": "Root=1-67451657-4fdc56e47b7240b358e7ef09",
+ "X-Forwarded-For": "50.35.61.49, 3.172.20.16",
+ "X-Forwarded-Port": "443",
+ "X-Forwarded-Proto": "https",
+ "ContentLength": "0",
+ "Content-Type": "application/json"
+ },
+ "queryStringParameters": null,
+ "multiValueQueryStringParameters": null,
+ "pathParameters": {
+ "proxy": "api/values/no-body"
+ },
+ "stageVariables": null,
+ "requestContext": {
+ "resourceId": "3r2bn3",
+ "resourcePath": "/{proxy+}",
+ "httpMethod": "PUT",
+ "extendedRequestId": "B1BtwG20vHcEp-g=",
+ "requestTime": "26/Nov/2024:00:29:11 +0000",
+ "path": "/Prod/api/values/test",
+ "accountId": "111122223333",
+ "protocol": "HTTP/1.1",
+ "stage": "Prod",
+ "domainPrefix": "example",
+ "requestTimeEpoch": 1732580951687,
+ "requestId": "b5738763-be0a-4ded-945b-a92895dbc5de",
+ "identity": {
+ "cognitoIdentityPoolId": null,
+ "accountId": null,
+ "cognitoIdentityId": null,
+ "caller": null,
+ "sourceIp": "50.35.61.49",
+ "principalOrgId": null,
+ "accessKey": null,
+ "cognitoAuthenticationType": null,
+ "cognitoAuthenticationProvider": null,
+ "userArn": null,
+ "userAgent": "PostmanRuntime/7.42.0",
+ "user": null
+ },
+ "domainName": "example.execute-api.us-west-2.amazonaws.com",
+ "deploymentId": "example",
+ "apiId": "example"
+ },
+ "body": null,
+ "isBase64Encoded": false
+}
\ No newline at end of file
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..cafd83fe4 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,15 +83,23 @@ public async Task NoInitializer()
}
[Fact]
- public async Task InitializerThrowsException()
+ public async Task InitializerHandlesExceptions()
{
+ bool exceptionThrown = false;
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);
+ try
+ {
+ await bootstrap.RunAsync();
+ }
+ catch
+ {
+ exceptionThrown = true;
+ }
}
+ Assert.True(exceptionThrown);
Assert.True(_testRuntimeApiClient.ReportInitializationErrorAsyncExceptionCalled);
Assert.True(_testInitializer.InitializerWasCalled);
Assert.False(_testFunction.HandlerWasCalled);
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/Libraries/test/TestExecutableServerlessApp/serverless.template b/Libraries/test/TestExecutableServerlessApp/serverless.template
index f48da3f1b..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.5.3.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 a1a5a1503..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.5.3.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 907b5cd42..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.5.3.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/TestWebApp/Controllers/ValuesController.cs b/Libraries/test/TestWebApp/Controllers/ValuesController.cs
index 3a96aeac3..87b675ebd 100644
--- a/Libraries/test/TestWebApp/Controllers/ValuesController.cs
+++ b/Libraries/test/TestWebApp/Controllers/ValuesController.cs
@@ -5,6 +5,7 @@
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.ModelBinding;
namespace TestWebApp.Controllers
{
@@ -49,5 +50,16 @@ public async Task ChectContentLength()
return Content(sb.ToString());
}
}
+
+ [HttpPut("no-body")]
+ public IActionResult Test([FromBody(EmptyBodyBehavior = EmptyBodyBehavior.Allow)] Body request = default)
+ {
+ return Accepted();
+ }
+
+ public class Body
+ {
+ public string Prop { get; set; }
+ }
}
}
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
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
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/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
diff --git a/buildtools/snapshotrestore.snk b/buildtools/snapshotrestore.snk
new file mode 100644
index 000000000..1cc91de31
Binary files /dev/null and b/buildtools/snapshotrestore.snk differ