Replies: 1 comment 2 replies
-
Ok I think I have found the code where how it's being handled: Can we actually made it slightly more intelligent by inspecting the provided |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have a list of lambda functions initiated using cdk by instantiating
NodejsFunction
, they are all fine, code can be inspected in lambda code editor once deployed. All@aws-sdk
libraries referenced are via normalrequire
statement.I only have one simple lambda function that has external dependency
docusign-esign
, which I have extracted and placed in a lambda layer. And the way I instantiate the lambda function in cdk is as below:Now when the function is deployed, code cannot be inspected inside the lambda code editor, file size is 368KB, upon downloading and opening up the source code, I found all the
@aws-sdk
libraries source code creeps into the source file, whereasdocusign-esign
is being included viarequire
.Next when I changed the above instantiation to be:
All the
@aws-sdk
libraries are referenced usingrequire
in the deployed lambda, code can be inspected, and size went down to 6KB.Is this something we should do at all time? whenever we are specifying
externalModules
ourselves we should include@aws-sdk
? Feels like an overkill, and it should be handled by cdk?Thank you,
Charles
Beta Was this translation helpful? Give feedback.
All reactions