11import * as cdk from 'aws-cdk-lib' ;
22import * as lambda from 'aws-cdk-lib/aws-lambda' ;
33import { Construct } from 'constructs' ;
4- import { createLogGroup , datadogEnvVariables , secretPolicy , getExtensionLayer , getDotnetLayer } from './util' ;
4+ import { createLogGroup , datadogEnvVariables , secretPolicy , getExtensionLayer , getDotnetLayer , getDotnetCode } from './util' ;
55
66export class BaseDotnetStack extends cdk . Stack {
77 constructor ( scope : Construct , id : string , props : cdk . StackProps ) {
@@ -12,7 +12,7 @@ export class BaseDotnetStack extends cdk.Stack {
1212 runtime : lambda . Runtime . DOTNET_8 ,
1313 architecture : lambda . Architecture . ARM_64 ,
1414 handler : 'BaseDotnet::BaseDotnet.Function::FunctionHandler' ,
15- code : lambda . Code . fromAsset ( './lambda/base-dotnet' ) ,
15+ code : getDotnetCode ( './lambda/base-dotnet' ) ,
1616 functionName : dotnetFunctionName ,
1717 timeout : cdk . Duration . seconds ( 30 ) ,
1818 memorySize : 512 ,
@@ -21,10 +21,6 @@ export class BaseDotnetStack extends cdk.Stack {
2121 DD_SERVICE : dotnetFunctionName ,
2222 DD_TRACE_ENABLED : 'true' ,
2323 AWS_LAMBDA_EXEC_WRAPPER : '/opt/datadog_wrapper' ,
24- CORECLR_ENABLE_PROFILING : '1' ,
25- CORECLR_PROFILER : '{846F5F1C-F9AE-4B07-969E-05C26BC060D8}' ,
26- CORECLR_PROFILER_PATH : '/opt/datadog/Datadog.Trace.ClrProfiler.Native.so' ,
27- DD_DOTNET_TRACER_HOME : '/opt/datadog' ,
2824 } ,
2925 logGroup : createLogGroup ( this , dotnetFunctionName )
3026 } ) ;
0 commit comments