Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ jobs:
17
21
25
- uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
# Install and configure Rust & Cargo Lambda
- name: Install and configure Rust & Cargo Lambda
if: ${{ matrix.os == 'ubuntu-latest' }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ jobs:
mvn --version
gradle --version

- name: Install .NET 8 SDK
- name: Install .NET 10 SDK
if: contains(fromJSON('["build-integ-java-python-provided", "build-integ-dotnet-node-ruby", "build-integ-arm64"]'), matrix.test_suite) && matrix.container_runtime == 'no-container' || matrix.test_suite == 'other-and-e2e'
uses: actions/setup-dotnet@v5
with:
dotnet-version: '8.0.x'
dotnet-version: '10.0.x'

- name: Set up Ruby 3.3.7
if: (contains(fromJSON('["build-integ","build-integ-dotnet-node-ruby", "build-integ-arm64"]'), matrix.test_suite) && matrix.container_runtime == 'no-container') || matrix.test_suite == 'other-and-e2e'
Expand Down
2 changes: 1 addition & 1 deletion samcli/commands/build/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
2. Nodejs 24.x, 22.x, 20.x, 18.x, 16.x, 14.x, 12.x using NPM\n
3. Ruby 3.2, 3.3, 3.4 using Bundler\n
4. Java 8, Java 11, Java 17, Java 21, Java 25 using Gradle and Maven\n
5. Dotnet8, Dotnet6 using Dotnet CLI\n
5. Dotnet6, Dotnet8, Dotnet10 using Dotnet CLI\n
6. Go 1.x using Go Modules (without --use-container)\n
"""

Expand Down
2 changes: 2 additions & 0 deletions samcli/lib/build/workflow_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def get_layer_subfolder(build_workflow: str) -> str:
"java25": "java",
"dotnet6": "dotnet",
"dotnet8": "dotnet",
"dotnet10": "dotnet",
# User is responsible for creating subfolder in these workflows
"makefile": "",
}
Expand Down Expand Up @@ -174,6 +175,7 @@ def get_workflow_config(
"ruby3.4": BasicWorkflowSelector(RUBY_BUNDLER_CONFIG),
"dotnet6": BasicWorkflowSelector(DOTNET_CLIPACKAGE_CONFIG),
"dotnet8": BasicWorkflowSelector(DOTNET_CLIPACKAGE_CONFIG),
"dotnet10": BasicWorkflowSelector(DOTNET_CLIPACKAGE_CONFIG),
"go1.x": BasicWorkflowSelector(GO_MOD_CONFIG),
# When Maven builder exists, add to this list so we can automatically choose a builder based on the supported
# manifest
Expand Down
1 change: 1 addition & 0 deletions samcli/lib/utils/architecture.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"go1.x": [X86_64],
"dotnet6": [ARM64, X86_64],
"dotnet8": [ARM64, X86_64],
"dotnet10": [ARM64, X86_64],
"provided": [X86_64],
"provided.al2": [ARM64, X86_64],
"provided.al2023": [ARM64, X86_64],
Expand Down
5 changes: 4 additions & 1 deletion samcli/local/common/runtime_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
],
"dotnet": [
{
"runtimes": ["dotnet8", "dotnet6"],
"runtimes": ["dotnet10", "dotnet8", "dotnet6"],
"dependency_manager": "cli-package",
"init_location": os.path.join(_templates, "cookiecutter-aws-sam-hello-dotnet"),
"build": True,
Expand Down Expand Up @@ -107,6 +107,7 @@ def get_local_lambda_images_location(mapping, runtime):
# Runtimes are ordered in alphabetical fashion with reverse version order (latest versions first)
INIT_RUNTIMES = [
# dotnet runtimes in descending order
"dotnet10",
"dotnet8",
"dotnet6",
# go runtimes in descending order
Expand Down Expand Up @@ -143,6 +144,7 @@ def get_local_lambda_images_location(mapping, runtime):


LAMBDA_IMAGES_RUNTIMES_MAP = {
"dotnet10": "amazon/dotnet10-base",
"dotnet8": "amazon/dotnet8-base",
"dotnet6": "amazon/dotnet6-base",
"go1.x": "amazon/go1.x-base",
Expand Down Expand Up @@ -190,6 +192,7 @@ def get_local_lambda_images_location(mapping, runtime):
"python3.14": "Python36",
"dotnet6": "dotnet6",
"dotnet8": "dotnet6",
"dotnet10": "dotnet6",
"go1.x": "Go1",
"provided.al2": "Go1",
}
Expand Down
4 changes: 4 additions & 0 deletions samcli/local/docker/lambda_debug_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ def get_debug_settings(debug_port, debug_args_list, _container_env_vars, runtime
entry + ["/var/runtime/bootstrap"] + debug_args_list,
container_env_vars={"_AWS_LAMBDA_DOTNET_DEBUGGING": "1", **_container_env_vars},
),
Runtime.dotnet10.value: lambda: DebugSettings(
entry + ["/var/runtime/bootstrap"] + debug_args_list,
container_env_vars={"_AWS_LAMBDA_DOTNET_DEBUGGING": "1", **_container_env_vars},
),
Runtime.go1x.value: lambda: DebugSettings(
entry,
container_env_vars={
Expand Down
1 change: 1 addition & 0 deletions samcli/local/docker/lambda_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class Runtime(Enum):
go1x = "go1.x"
dotnet6 = "dotnet6"
dotnet8 = "dotnet8"
dotnet10 = "dotnet10"
provided = "provided"
providedal2 = "provided.al2"
providedal2023 = "provided.al2023"
Expand Down
13 changes: 8 additions & 5 deletions schema/samcli.json

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions tests/integration/buildcmd/test_build_cmd_dotnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ def test_dotnet_6(self, runtime, code_uri, mode, mount_mode):
("dotnet8", "Dotnet8", None, MountMode.WRITE),
("dotnet8", "Dotnet8", "debug", None),
("dotnet8", "Dotnet8", "debug", MountMode.WRITE),
("dotnet10", "Dotnet10", None, None),
("dotnet10", "Dotnet10", None, MountMode.WRITE),
("dotnet10", "Dotnet10", "debug", None),
("dotnet10", "Dotnet10", "debug", MountMode.WRITE),
]
)
@skipIf(SKIP_DOCKER_TESTS or SKIP_DOCKER_BUILD, SKIP_DOCKER_MESSAGE)
Expand Down Expand Up @@ -151,6 +155,8 @@ def test_dotnet_6_in_container(self, runtime, code_uri, mode):
[
("dotnet8", "Dotnet8", None),
("dotnet8", "Dotnet8", "debug"),
("dotnet10", "Dotnet10", None),
("dotnet10", "Dotnet10", "debug"),
]
)
@skipIf(SKIP_DOCKER_TESTS or SKIP_DOCKER_BUILD, SKIP_DOCKER_MESSAGE)
Expand Down
15 changes: 15 additions & 0 deletions tests/integration/testdata/buildcmd/Dotnet10/HelloWorld.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Amazon.Lambda.Core" Version="2.2.0" />
<PackageReference Include="Amazon.Lambda.APIGatewayEvents" Version="2.7.0" />
<PackageReference Include="Amazon.Lambda.Serialization.Json" Version="2.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

</Project>
36 changes: 36 additions & 0 deletions tests/integration/testdata/buildcmd/Dotnet10/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using Amazon.Lambda.Core;
using Amazon.Lambda.APIGatewayEvents;

// Assembly attribute to enable the Lambda function's JSON input to be converted into a .NET class.
[assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))]

namespace HelloWorld
{

public class Function
{

public string FunctionHandler(APIGatewayProxyRequest apigProxyEvent, ILambdaContext context)
{
return "{'message': 'Hello World'}";
}
}

public class FirstFunction
{

public string FunctionHandler(APIGatewayProxyRequest apigProxyEvent, ILambdaContext context)
{
return "Hello World";
}
}

public class SecondFunction
{

public string FunctionHandler(APIGatewayProxyRequest apigProxyEvent, ILambdaContext context)
{
return "Hello Mars";
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"Information" : [
"This file provides default values for the deployment wizard inside Visual Studio and the AWS Lambda commands added to the .NET Core CLI.",
"To learn more about the Lambda commands with the .NET Core CLI execute the following command at the command line in the project root directory.",

"dotnet lambda help",

"All the command line options for the Lambda command can be specified in this file."
],

"profile":"",
"region" : "",
"configuration": "Release",
"framework": "net10.0",
"function-runtime":"dotnet10",
"function-memory-size" : 256,
"function-timeout" : 30,
"function-handler" : "HelloWorld::HelloWorld.Function::FunctionHandler"
}
1 change: 1 addition & 0 deletions tests/integration/validate/test_validate_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ def test_lint_supported_runtimes(self):
"Resources": {},
}
supported_runtimes = [
"dotnet10",
"dotnet8",
"java21",
"java17",
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/local/docker/test_lambda_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from samcli.local.docker.lambda_debug_settings import DebuggingNotSupported
from samcli.local.docker.lambda_image import RAPID_IMAGE_TAG_PREFIX

RUNTIMES_WITH_ENTRYPOINT = [Runtime.dotnet6.value, Runtime.dotnet8.value, Runtime.go1x.value]
RUNTIMES_WITH_ENTRYPOINT = [Runtime.dotnet6.value, Runtime.dotnet8.value, Runtime.dotnet10.value, Runtime.go1x.value]

RUNTIMES_WITH_BOOTSTRAP_ENTRYPOINT = [
Runtime.nodejs16x.value,
Expand All @@ -31,6 +31,7 @@
Runtime.python314.value,
Runtime.dotnet6.value,
Runtime.dotnet8.value,
Runtime.dotnet10.value,
]

RUNTIMES_WITH_DEBUG_ENV_VARS_ONLY = [
Expand Down
1 change: 1 addition & 0 deletions tests/unit/local/docker/test_lambda_debug_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
Runtime.java25,
Runtime.dotnet6,
Runtime.dotnet8,
Runtime.dotnet10,
Runtime.go1x,
Runtime.nodejs16x,
Runtime.nodejs18x,
Expand Down
1 change: 1 addition & 0 deletions tests/unit/local/docker/test_lambda_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class TestRuntime(TestCase):
("go1.x", "go:1"),
("dotnet6", "dotnet:6-x86_64"),
("dotnet8", "dotnet:8-x86_64"),
("dotnet10", "dotnet:10-x86_64"),
("provided", "provided:alami"),
("provided.al2", "provided:al2-x86_64"),
("provided.al2023", "provided:al2023-x86_64"),
Expand Down
Loading