diff --git a/integration_tests/correct_extension_apigateway_snapshot.json b/integration_tests/correct_extension_apigateway_snapshot.json index 1d253920..702ddefd 100644 --- a/integration_tests/correct_extension_apigateway_snapshot.json +++ b/integration_tests/correct_extension_apigateway_snapshot.json @@ -161,6 +161,18 @@ "LogGroupName": "/aws/lambda/dd-sls-plugin-integration-test-dev-DotnetHello8" } }, + "DotnetHello10LogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/dd-sls-plugin-integration-test-dev-DotnetHello10" + } + }, + "DotnetArmHello10LogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/dd-sls-plugin-integration-test-dev-DotnetArmHello10" + } + }, "JavaHello8LogGroup": { "Type": "AWS::Logs::LogGroup", "Properties": { @@ -1060,6 +1072,109 @@ "DotnetHello8LogGroup" ] }, + "DotnetHello10LambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Ref": "ServerlessDeploymentBucket" + }, + "S3Key": "serverless/dd-sls-plugin-integration-test/dev/XXXXXXXXXXXXX-XXXX-XX-XXXXX:XX:XX.XXXX/dd-sls-plugin-integration-test.zip" + }, + "Handler": "dotnet_handler.hello", + "Runtime": "dotnet10", + "FunctionName": "dd-sls-plugin-integration-test-dev-DotnetHello10", + "MemorySize": 1024, + "Timeout": 6, + "Tags": [ + { + "Key": "dd_sls_plugin", + "Value": "vX.XX.X" + } + ], + "Environment": { + "Variables": { + "DD_API_KEY": 1234, + "DD_SITE": "datadoghq.com", + "DD_LOG_LEVEL": "info", + "DD_TRACE_ENABLED": true, + "DD_MERGE_XRAY_TRACES": false, + "DD_LOGS_INJECTION": false, + "DD_SERVERLESS_LOGS_ENABLED": true, + "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "AWS_LAMBDA_EXEC_WRAPPER": "/opt/datadog_wrapper", + "DD_SERVICE": "dd-sls-plugin-integration-test", + "DD_ENV": "dev" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + }, + "Layers": [ + "arn:aws:lambda:sa-east-1:464622532012:layer:dd-trace-dotnet:XXX", + "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Extension:XXX" + ] + }, + "DependsOn": [ + "DotnetHello10LogGroup" + ] + }, + "DotnetArmHello10LambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Ref": "ServerlessDeploymentBucket" + }, + "S3Key": "serverless/dd-sls-plugin-integration-test/dev/XXXXXXXXXXXXX-XXXX-XX-XXXXX:XX:XX.XXXX/dd-sls-plugin-integration-test.zip" + }, + "Handler": "dotnet_handler.hello", + "Runtime": "dotnet10", + "FunctionName": "dd-sls-plugin-integration-test-dev-DotnetArmHello10", + "MemorySize": 1024, + "Timeout": 6, + "Architectures": [ + "arm64" + ], + "Tags": [ + { + "Key": "dd_sls_plugin", + "Value": "vX.XX.X" + } + ], + "Environment": { + "Variables": { + "DD_API_KEY": 1234, + "DD_SITE": "datadoghq.com", + "DD_LOG_LEVEL": "info", + "DD_TRACE_ENABLED": true, + "DD_MERGE_XRAY_TRACES": false, + "DD_LOGS_INJECTION": false, + "DD_SERVERLESS_LOGS_ENABLED": true, + "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "AWS_LAMBDA_EXEC_WRAPPER": "/opt/datadog_wrapper", + "DD_SERVICE": "dd-sls-plugin-integration-test", + "DD_ENV": "dev" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + }, + "Layers": [ + "arn:aws:lambda:sa-east-1:464622532012:layer:dd-trace-dotnet:XXX", + "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Extension:XXX" + ] + }, + "DependsOn": [ + "DotnetArmHello10LogGroup" + ] + }, "JavaHello8LambdaFunction": { "Type": "AWS::Lambda::Function", "Properties": { @@ -1701,6 +1816,26 @@ "CodeSha256": "XXXX" } }, + "DotnetHello10LambdaVersionXXXX": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "DotnetHello10LambdaFunction" + }, + "CodeSha256": "XXXX" + } + }, + "DotnetArmHello10LambdaVersionXXXX": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "DotnetArmHello10LambdaFunction" + }, + "CodeSha256": "XXXX" + } + }, "JavaHello8LambdaVersionXXXX": { "Type": "AWS::Lambda::Version", "DeletionPolicy": "Retain", @@ -2677,6 +2812,24 @@ "Name": "sls-dd-sls-plugin-integration-test-dev-DotnetHello8LambdaFunctionQualifiedArn" } }, + "DotnetHello10LambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "DotnetHello10LambdaVersionXXXX" + }, + "Export": { + "Name": "sls-dd-sls-plugin-integration-test-dev-DotnetHello10LambdaFunctionQualifiedArn" + } + }, + "DotnetArmHello10LambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "DotnetArmHello10LambdaVersionXXXX" + }, + "Export": { + "Name": "sls-dd-sls-plugin-integration-test-dev-DotnetArmHello10LambdaFunctionQualifiedArn" + } + }, "JavaHello8LambdaFunctionQualifiedArn": { "Description": "Current Lambda function version", "Value": { diff --git a/integration_tests/correct_extension_snapshot.json b/integration_tests/correct_extension_snapshot.json index 1642e992..6117bdaa 100644 --- a/integration_tests/correct_extension_snapshot.json +++ b/integration_tests/correct_extension_snapshot.json @@ -179,6 +179,18 @@ "LogGroupName": "/aws/lambda/dd-sls-plugin-integration-test-dev-DotnetArmHello8" } }, + "DotnetHello10LogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/dd-sls-plugin-integration-test-dev-DotnetHello10" + } + }, + "DotnetArmHello10LogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/dd-sls-plugin-integration-test-dev-DotnetArmHello10" + } + }, "JavaHello8LogGroup": { "Type": "AWS::Logs::LogGroup", "Properties": { @@ -1269,6 +1281,113 @@ "DotnetArmHello8LogGroup" ] }, + "DotnetHello10LambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Ref": "ServerlessDeploymentBucket" + }, + "S3Key": "serverless/dd-sls-plugin-integration-test/dev/XXXXXXXXXXXXX-XXXX-XX-XXXXX:XX:XX.XXXX/dd-sls-plugin-integration-test.zip" + }, + "Handler": "dotnet_handler.hello", + "Runtime": "dotnet10", + "FunctionName": "dd-sls-plugin-integration-test-dev-DotnetHello10", + "MemorySize": 1024, + "Timeout": 6, + "Tags": [ + { + "Key": "dd_sls_plugin", + "Value": "vX.XX.X" + } + ], + "Environment": { + "Variables": { + "DD_API_KEY": 1234, + "DD_SITE": "datadoghq.com", + "DD_TRACE_ENABLED": true, + "DD_MERGE_XRAY_TRACES": false, + "DD_LOGS_INJECTION": false, + "DD_SERVERLESS_LOGS_ENABLED": true, + "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "AWS_LAMBDA_EXEC_WRAPPER": "/opt/datadog_wrapper", + "DD_SERVICE": "dd-sls-plugin-integration-test", + "DD_ENV": "dev" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + }, + "Layers": [ + { + "Ref": "ProviderLevelLayerLambdaLayer" + }, + "arn:aws:lambda:sa-east-1:464622532012:layer:dd-trace-dotnet:XXX", + "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Extension:XXX" + ] + }, + "DependsOn": [ + "DotnetHello10LogGroup" + ] + }, + "DotnetArmHello10LambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Ref": "ServerlessDeploymentBucket" + }, + "S3Key": "serverless/dd-sls-plugin-integration-test/dev/XXXXXXXXXXXXX-XXXX-XX-XXXXX:XX:XX.XXXX/dd-sls-plugin-integration-test.zip" + }, + "Handler": "dotnet_handler.hello", + "Runtime": "dotnet10", + "FunctionName": "dd-sls-plugin-integration-test-dev-DotnetArmHello10", + "MemorySize": 1024, + "Timeout": 6, + "Architectures": [ + "arm64" + ], + "Tags": [ + { + "Key": "dd_sls_plugin", + "Value": "vX.XX.X" + } + ], + "Environment": { + "Variables": { + "DD_API_KEY": 1234, + "DD_SITE": "datadoghq.com", + "DD_TRACE_ENABLED": true, + "DD_MERGE_XRAY_TRACES": false, + "DD_LOGS_INJECTION": false, + "DD_SERVERLESS_LOGS_ENABLED": true, + "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "AWS_LAMBDA_EXEC_WRAPPER": "/opt/datadog_wrapper", + "DD_SERVICE": "dd-sls-plugin-integration-test", + "DD_ENV": "dev" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + }, + "Layers": [ + { + "Ref": "ProviderLevelLayerLambdaLayer" + }, + "arn:aws:lambda:sa-east-1:464622532012:layer:dd-trace-dotnet:XXX", + "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Extension:XXX" + ] + }, + "DependsOn": [ + "DotnetArmHello10LogGroup" + ] + }, "JavaHello8LambdaFunction": { "Type": "AWS::Lambda::Function", "Properties": { @@ -1950,6 +2069,26 @@ "CodeSha256": "XXXX" } }, + "DotnetHello10LambdaVersionXXXX": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "DotnetHello10LambdaFunction" + }, + "CodeSha256": "XXXX" + } + }, + "DotnetArmHello10LambdaVersionXXXX": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "DotnetArmHello10LambdaFunction" + }, + "CodeSha256": "XXXX" + } + }, "JavaHello8LambdaVersionXXXX": { "Type": "AWS::Lambda::Version", "DeletionPolicy": "Retain", @@ -2269,6 +2408,24 @@ "Name": "sls-dd-sls-plugin-integration-test-dev-DotnetArmHello8LambdaFunctionQualifiedArn" } }, + "DotnetHello10LambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "DotnetHello10LambdaVersionXXXX" + }, + "Export": { + "Name": "sls-dd-sls-plugin-integration-test-dev-DotnetHello10LambdaFunctionQualifiedArn" + } + }, + "DotnetArmHello10LambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "DotnetArmHello10LambdaVersionXXXX" + }, + "Export": { + "Name": "sls-dd-sls-plugin-integration-test-dev-DotnetArmHello10LambdaFunctionQualifiedArn" + } + }, "JavaHello8LambdaFunctionQualifiedArn": { "Description": "Current Lambda function version", "Value": { diff --git a/integration_tests/correct_forwarder_snapshot.json b/integration_tests/correct_forwarder_snapshot.json index 8339379e..b950786b 100644 --- a/integration_tests/correct_forwarder_snapshot.json +++ b/integration_tests/correct_forwarder_snapshot.json @@ -173,6 +173,18 @@ "LogGroupName": "/aws/lambda/dd-sls-plugin-integration-test-dev-DotnetHello8" } }, + "DotnetHello10LogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/dd-sls-plugin-integration-test-dev-DotnetHello10" + } + }, + "DotnetArmHello10LogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/dd-sls-plugin-integration-test-dev-DotnetArmHello10" + } + }, "JavaHello8LogGroup": { "Type": "AWS::Logs::LogGroup", "Properties": { @@ -472,6 +484,26 @@ } } }, + "DotnetHello10LogGroupSubscription": { + "Type": "AWS::Logs::SubscriptionFilter", + "Properties": { + "DestinationArn": "arn:aws:lambda:us-east-1:000000000000:function:datadog-forwarder", + "FilterPattern": "", + "LogGroupName": { + "Ref": "DotnetHello10LogGroup" + } + } + }, + "DotnetArmHello10LogGroupSubscription": { + "Type": "AWS::Logs::SubscriptionFilter", + "Properties": { + "DestinationArn": "arn:aws:lambda:us-east-1:000000000000:function:datadog-forwarder", + "FilterPattern": "", + "LogGroupName": { + "Ref": "DotnetArmHello10LogGroup" + } + } + }, "JavaHello8LogGroupSubscription": { "Type": "AWS::Logs::SubscriptionFilter", "Properties": { @@ -1543,6 +1575,111 @@ "DotnetHello8LogGroup" ] }, + "DotnetHello10LambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Ref": "ServerlessDeploymentBucket" + }, + "S3Key": "serverless/dd-sls-plugin-integration-test/dev/XXXXXXXXXXXXX-XXXX-XX-XXXXX:XX:XX.XXXX/dd-sls-plugin-integration-test.zip" + }, + "Handler": "dotnet_handler.hello", + "Runtime": "dotnet10", + "FunctionName": "dd-sls-plugin-integration-test-dev-DotnetHello10", + "MemorySize": 1024, + "Timeout": 6, + "Tags": [ + { + "Key": "dd_sls_plugin", + "Value": "vX.XX.X" + }, + { + "Key": "service", + "Value": "dd-sls-plugin-integration-test" + }, + { + "Key": "env", + "Value": "dev" + } + ], + "Environment": { + "Variables": { + "DD_SITE": "datadoghq.com", + "DD_LOG_LEVEL": "info", + "DD_FLUSH_TO_LOG": true, + "DD_TRACE_ENABLED": true, + "DD_MERGE_XRAY_TRACES": false, + "DD_LOGS_INJECTION": true, + "DD_SERVERLESS_LOGS_ENABLED": true, + "DD_CAPTURE_LAMBDA_PAYLOAD": false + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "DotnetHello10LogGroup" + ] + }, + "DotnetArmHello10LambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Ref": "ServerlessDeploymentBucket" + }, + "S3Key": "serverless/dd-sls-plugin-integration-test/dev/XXXXXXXXXXXXX-XXXX-XX-XXXXX:XX:XX.XXXX/dd-sls-plugin-integration-test.zip" + }, + "Handler": "dotnet_handler.hello", + "Runtime": "dotnet10", + "FunctionName": "dd-sls-plugin-integration-test-dev-DotnetArmHello10", + "MemorySize": 1024, + "Timeout": 6, + "Architectures": [ + "arm64" + ], + "Tags": [ + { + "Key": "dd_sls_plugin", + "Value": "vX.XX.X" + }, + { + "Key": "service", + "Value": "dd-sls-plugin-integration-test" + }, + { + "Key": "env", + "Value": "dev" + } + ], + "Environment": { + "Variables": { + "DD_SITE": "datadoghq.com", + "DD_LOG_LEVEL": "info", + "DD_FLUSH_TO_LOG": true, + "DD_TRACE_ENABLED": true, + "DD_MERGE_XRAY_TRACES": false, + "DD_LOGS_INJECTION": true, + "DD_SERVERLESS_LOGS_ENABLED": true, + "DD_CAPTURE_LAMBDA_PAYLOAD": false + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "DotnetArmHello10LogGroup" + ] + }, "JavaHello8LambdaFunction": { "Type": "AWS::Lambda::Function", "Properties": { @@ -2232,6 +2369,26 @@ "CodeSha256": "XXXX" } }, + "DotnetHello10LambdaVersionXXXX": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "DotnetHello10LambdaFunction" + }, + "CodeSha256": "XXXX" + } + }, + "DotnetArmHello10LambdaVersionXXXX": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "DotnetArmHello10LambdaFunction" + }, + "CodeSha256": "XXXX" + } + }, "JavaHello8LambdaVersionXXXX": { "Type": "AWS::Lambda::Version", "DeletionPolicy": "Retain", @@ -3567,6 +3724,24 @@ "Name": "sls-dd-sls-plugin-integration-test-dev-DotnetHello8LambdaFunctionQualifiedArn" } }, + "DotnetHello10LambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "DotnetHello10LambdaVersionXXXX" + }, + "Export": { + "Name": "sls-dd-sls-plugin-integration-test-dev-DotnetHello10LambdaFunctionQualifiedArn" + } + }, + "DotnetArmHello10LambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "DotnetArmHello10LambdaVersionXXXX" + }, + "Export": { + "Name": "sls-dd-sls-plugin-integration-test-dev-DotnetArmHello10LambdaFunctionQualifiedArn" + } + }, "JavaHello8LambdaFunctionQualifiedArn": { "Description": "Current Lambda function version", "Value": { diff --git a/integration_tests/serverless-extension-apigateway.yml b/integration_tests/serverless-extension-apigateway.yml index 730930bd..3b272599 100644 --- a/integration_tests/serverless-extension-apigateway.yml +++ b/integration_tests/serverless-extension-apigateway.yml @@ -84,6 +84,13 @@ functions: DotnetHello8: handler: dotnet_handler.hello runtime: dotnet8 + DotnetHello10: + handler: dotnet_handler.hello + runtime: dotnet10 + DotnetArmHello10: + handler: dotnet_handler.hello + runtime: dotnet10 + architecture: arm64 JavaHello8: handler: java_handler.hello runtime: java8 diff --git a/integration_tests/serverless-extension.yml b/integration_tests/serverless-extension.yml index da24de1b..cdd127ae 100644 --- a/integration_tests/serverless-extension.yml +++ b/integration_tests/serverless-extension.yml @@ -79,6 +79,13 @@ functions: handler: dotnet_handler.hello runtime: dotnet8 architecture: arm64 + DotnetHello10: + handler: dotnet_handler.hello + runtime: dotnet10 + DotnetArmHello10: + handler: dotnet_handler.hello + runtime: dotnet10 + architecture: arm64 JavaHello8: handler: java_handler.hello runtime: java8 diff --git a/integration_tests/serverless-forwarder.yml b/integration_tests/serverless-forwarder.yml index 35745a79..216b8e4d 100644 --- a/integration_tests/serverless-forwarder.yml +++ b/integration_tests/serverless-forwarder.yml @@ -96,6 +96,13 @@ functions: DotnetHello8: handler: dotnet_handler.hello runtime: dotnet8 + DotnetHello10: + handler: dotnet_handler.hello + runtime: dotnet10 + DotnetArmHello10: + handler: dotnet_handler.hello + runtime: dotnet10 + architecture: arm64 JavaHello8: handler: java_handler.hello runtime: java8 diff --git a/src/layer.spec.ts b/src/layer.spec.ts index c9caa1c0..8b4d137a 100644 --- a/src/layer.spec.ts +++ b/src/layer.spec.ts @@ -66,6 +66,7 @@ describe("findHandlers", () => { "java25-function": { handler: "myfile.handler", runtime: "java25" }, "dotnet6-function": { handler: "myfile.handler", runtime: "dotnet6" }, "dotnet8-function": { handler: "myfile.handler", runtime: "dotnet8" }, + "dotnet10-function": { handler: "myfile.handler", runtime: "dotnet10" }, "provided-function": { handler: "myfile.handler", runtime: "provided" }, "provided.al2023-function": { handler: "myfile.handler", runtime: "provided.al2023" }, }); @@ -222,6 +223,12 @@ describe("findHandlers", () => { type: RuntimeType.DOTNET, runtime: "dotnet8", }, + { + name: "dotnet10-function", + handler: { handler: "myfile.handler", runtime: "dotnet10" }, + type: RuntimeType.DOTNET, + runtime: "dotnet10", + }, { name: "provided-function", handler: { handler: "myfile.handler", runtime: "provided" }, diff --git a/src/layer.ts b/src/layer.ts index 4a413ab3..5c458886 100644 --- a/src/layer.ts +++ b/src/layer.ts @@ -70,6 +70,7 @@ export const runtimeLookup: { [key: string]: RuntimeType } = { "python3.14": RuntimeType.PYTHON, dotnet6: RuntimeType.DOTNET, dotnet8: RuntimeType.DOTNET, + dotnet10: RuntimeType.DOTNET, java11: RuntimeType.JAVA, java17: RuntimeType.JAVA, java21: RuntimeType.JAVA,