-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
(core/aws-lambda-nodejs/cli): confusing NodejsFunction+Stage+exclusive-cli-flag behaviour #15346
Comments
Thanks for the detailed investigation! Unfortunately we ourselves might not be able to get to this quickly, as there are many issues competing for our attention. I hope @jogold has some spare cycles to investigate, otherwise please collect upvotes on this issue to raise the priority. |
@plumdog I pulled your repo and ran Looks to me that the |
possible duplicate #12898 |
…r stage (#17210) We were comparing bundling stacks of the form `Stage/Stack` with stack names of the form `Stage-Stack`. For stacks with `NodejsFunction`s this leads to assets containing the whole CDK project because when bundling is skipped the asset references the source directory which is the project root. Closes #12898 Closes #15346 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
…r stage (aws#17210) We were comparing bundling stacks of the form `Stage/Stack` with stack names of the form `Stage-Stack`. For stacks with `NodejsFunction`s this leads to assets containing the whole CDK project because when bundling is skipped the asset references the source directory which is the project root. Closes aws#12898 Closes aws#15346 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…r stage (aws#17210) We were comparing bundling stacks of the form `Stage/Stack` with stack names of the form `Stage-Stack`. For stacks with `NodejsFunction`s this leads to assets containing the whole CDK project because when bundling is skipped the asset references the source directory which is the project root. Closes aws#12898 Closes aws#15346 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
When deploying using all of the following, the asset for the Lambda function is a zip of the root of the project, not the asset as expected:
@aws-cdk/aws-lambda-nodejs.NodejsFunction
Lambda function@aws-cdk/core.Stage
rather than to a@aws-cdk/core.App
-e
(exclusive) flag to the synth or deploy commandsBased on my testing, not doing any one of these things results in the expected behaviour where the asset is the expected thing.
See dummy project here https://github.com/isotoma/cdk-nodejsfunction-asset-size-debugging to show my testing and why I have ended up where I have.
I happened to find this because a real project uploaded the whole project root as the source asset for the Lambda, which ended up being over Lambda's 250MB limit.
Reproduction Steps
See https://github.com/isotoma/cdk-nodejsfunction-asset-size-debugging, and the branches listed in the readme, and the behaviour shown in the Github CI.
What did you expect to happen?
-e
CLI flag should not affect the built assetStage
should not affect the built assetWhat actually happened?
Environment
Other
I am mildly suspicious of switches in
context
incdk.json
, but for no real reason, and have no guesses as to what might actually be wrong.Happy to try other things with my dummy project if useful.
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: