-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
@aws-cdk/aws-lambdaRelated to AWS LambdaRelated to AWS LambdabugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp2
Description
Describe the bug
When creating a lambda function using CDK Java, if the lambda jar file path mentioned as "" in the Code parameter, the synth/diff/deploy process initiates an infinite recursive creation of directories "cdk.out/asset-xxx/cdk.out/asset-xxx/,,,".
It throws an error at the end when the file path is too deep. There is no warning if the asset folder is not mentioned.
Also this leads to a blue screen when the project is opened in Eclipse.
Please fix this issue.
Expected Behavior
Throw an error that the asset path is not provided.
Current Behavior
Creation of infinite nested folders.
Reproduction Steps
FunctionProps props = FunctionProps.builder()
.code(Code.fromAsset(""))
.handler("com.example.action.handler.MyAction")
.functionName("MyFunction")
.runtime(Runtime.JAVA_11)
.logRetention(RetentionDays.ONE_WEEK)
.role(f1Role)
.build();
Function f1 = new Function(this,"Fun", props);
Possible Solution
Stop the synthesis and throw an error message that the asset path cannot be a zero-lenth string.
Additional Information/Context
No response
CDK CLI Version
2.102.0
Framework Version
2.102.0
Node.js Version
v18.16.0
OS
Windows 10
Language
Java
Language Version
11
Other information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-lambdaRelated to AWS LambdaRelated to AWS LambdabugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp2