-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[aws-lambda-nodejs] LambdaNodeJs bundles lambda code into cdk.staging directory when using cdk synth --no-staging #9189
Comments
@eladb what do you think here? Should we simply disable bundling when staging is disabled?
aws-cdk/packages/@aws-cdk/core/lib/asset-staging.ts Lines 91 to 93 in d287525
|
Feels weird to completely disable asset bundling for all assets (whether they are part of your app or not). Would it make sense to specify which assets we want to skip? This whole behavior around disabling asset staging feels a bit hacky, but the use case of local lambda debugging still stands. Also, I would include a warning if bundling is disabled. |
Curious what the status is on this bug? I'm experiencing the same issue. |
This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
I write this comment so the issue is not closed and can be solved |
@Sevi7 @dave-graham Is this still an issue for you? I'm not sure I follow how you would be able to have the Lambda code updated without re-running synth since synth is what bundles the code? |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
@corymhall I think we did not mention to have the Lambda code updated without re-running synth. We are running synth to have the code updated, the problem is the cloudformation output template should still refer to the lambda file that has been developed instead of the path that it is written (see aws:asset:path):
The documentation for cdk synth --staging says:
And this is not happening. For aws-lambda it works but not for aws-lambda-nodejs as it is the case |
@Sevi7 I'm not super familiar with how SAM CLI works. Does the SAM CLI also perform some bundling? I think the piece that I'm struggling to understand is why you would want it to point to the source code instead of the bundled code. |
@corymhall For |
I would like to use this feature for local debugging too with SAM CLI. Any updates @corymhall? |
When cdk synth --no-staging is run, it should still refer to the lambda file that has been developed, to enable local development and debugging.
I would expect the aws:asset:path to still refer to the original file, rather than bundled version when adding --no-staging, but it's looking like:
aws:asset:path: /Users/user-name/path-to-project/.cdk.staging/asset-bundle-L5zSs8
This is preventing me from using breakpoints in vscode to debug, using for example:
echo '{}' | sam local invoke -d 9999 ServerlessFunctionName
Or even just general debugging, as I need to run a cdk synth each time I make a change to the lambda.
Also thanks for the work on lambda-nodejs, it's great, and really simplifies some workflows I would otherwise have to manually put together.
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: