@@ -31,39 +31,41 @@ public IdempotencyStack(Construct scope, string id, IdempotencyStackProps props)
31
31
{
32
32
var baseAotPath = $ "../functions/{ utility } /AOT-Function/src/AOT-Function";
33
33
var distAotPath = $ "../functions/{ utility } /AOT-Function/dist";
34
+ var path = new Path ( baseAotPath , distAotPath ) ;
34
35
35
36
var architecture = props . ArchitectureString == "arm64" ? Architecture . ARM_64 : Architecture . X86_64 ;
36
37
var arch = architecture == Architecture . X86_64 ? "X64" : "ARM" ;
37
38
CreateFunctionConstruct ( this , $ "{ utility } _{ arch } _aot_net8", Runtime . DOTNET_8 , architecture ,
38
- $ "E2ETestLambda_{ arch } _AOT_NET8_{ utility } ", baseAotPath , distAotPath , props ) ;
39
+ $ "E2ETestLambda_{ arch } _AOT_NET8_{ utility } ", path , props ) ;
39
40
}
40
41
else
41
42
{
42
43
var basePath = $ "../functions/{ utility } /Function/src/Function";
43
44
var distPath = $ "../functions/{ utility } /Function/dist";
45
+ var path = new Path ( basePath , distPath ) ;
44
46
45
47
CreateFunctionConstruct ( this , $ "{ utility } _X64_net8", Runtime . DOTNET_8 , Architecture . X86_64 ,
46
- $ "E2ETestLambda_X64_NET8_{ utility } ", basePath , distPath , props ) ;
48
+ $ "E2ETestLambda_X64_NET8_{ utility } ", path , props ) ;
47
49
CreateFunctionConstruct ( this , $ "{ utility } _arm_net8", Runtime . DOTNET_8 , Architecture . ARM_64 ,
48
- $ "E2ETestLambda_ARM_NET8_{ utility } ", basePath , distPath , props ) ;
50
+ $ "E2ETestLambda_ARM_NET8_{ utility } ", path , props ) ;
49
51
CreateFunctionConstruct ( this , $ "{ utility } _X64_net6", Runtime . DOTNET_6 , Architecture . X86_64 ,
50
- $ "E2ETestLambda_X64_NET6_{ utility } ", basePath , distPath , props ) ;
52
+ $ "E2ETestLambda_X64_NET6_{ utility } ", path , props ) ;
51
53
CreateFunctionConstruct ( this , $ "{ utility } _arm_net6", Runtime . DOTNET_6 , Architecture . ARM_64 ,
52
- $ "E2ETestLambda_ARM_NET6_{ utility } ", basePath , distPath , props ) ;
54
+ $ "E2ETestLambda_ARM_NET6_{ utility } ", path , props ) ;
53
55
}
54
56
}
55
57
56
58
private void CreateFunctionConstruct ( Construct scope , string id , Runtime runtime , Architecture architecture ,
57
- string name , string sourcePath , string distPath , PowertoolsDefaultStackProps props )
59
+ string name , Path path , PowertoolsDefaultStackProps props )
58
60
{
59
61
var lambdaFunction = new FunctionConstruct ( scope , id , new FunctionConstructProps
60
62
{
61
63
Runtime = runtime ,
62
64
Architecture = architecture ,
63
65
Name = name ,
64
66
Handler = props . IsAot ? "AOT-Function" : "Function::Function.Function::FunctionHandler" ,
65
- SourcePath = sourcePath ,
66
- DistPath = distPath ,
67
+ SourcePath = path . SourcePath ,
68
+ DistPath = path . DistPath ,
67
69
Environment = new Dictionary < string , string >
68
70
{
69
71
{ "IDEMPOTENCY_TABLE_NAME" , Table . TableName }
@@ -75,3 +77,5 @@ private void CreateFunctionConstruct(Construct scope, string id, Runtime runtime
75
77
Table . GrantReadWriteData ( lambdaFunction . Function ) ;
76
78
}
77
79
}
80
+
81
+ public record Path ( string SourcePath , string DistPath ) ;
0 commit comments