-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
(software.amazon.awscdk.services.lambda.Function): Recursive folder creation in cdk.out when lambda jar path is mentioned as "" #29410
Closed
lohithsamaga opened this issue
Mar 8, 2024
· 2 comments
· Fixed by #29425 · 4 remaining pull requests
Closed
(software.amazon.awscdk.services.lambda.Function): Recursive folder creation in cdk.out when lambda jar path is mentioned as "" #29410
lohithsamaga opened this issue
Mar 8, 2024
· 2 comments
· Fixed by #29425 · 4 remaining pull requests
Labels
@aws-cdk/aws-lambda
Related to AWS Lambda
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
p2
Comments
lohithsamaga
added
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
labels
Mar 8, 2024
pahud
added
p2
effort/medium
Medium work item – several days of effort
effort/small
Small work item – less than a day of effort
and removed
needs-triage
This issue or PR still needs to be triaged.
effort/medium
Medium work item – several days of effort
labels
Mar 8, 2024
Yes we should check if the asset path exists. |
1 task
mergify bot
pushed a commit
that referenced
this issue
Apr 4, 2024
### Issue # (if applicable) Closes #29410. ### Reason for this change It was reported that a `Code.fromAsset('')` was creating an infinite loop by including itself through `cdk.out`. This is caused by the following line: https://github.com/aws/aws-cdk/blob/730fe63efc461c14f6e2b4aa9206c10f9b0f4cd9/packages/aws-cdk-lib/aws-s3-assets/lib/asset.ts#L145 If an empty string is given to `path.resolve()`, the current working directory is returned. ### Description of changes I've added a check that verifies that the given `path` property is not empty. ### Description of how you validated changes I've added a test for both the `aws-lambda` package, where the issue was originally reported, and `aws-s3-assets`, where the fix was implemented ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
This was referenced May 23, 2024
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
@aws-cdk/aws-lambda
Related to AWS Lambda
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
p2
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
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
The text was updated successfully, but these errors were encountered: