Hey everyone (originally posted in <cdk.dev> but w...
# help
c
Hey everyone (originally posted in cdk.dev but will try here) Just want to check, every time we build/deploy our CDK app, CDK bundles all of our functions. This occurs even if the function code doesn't change. We have a lot of functions so the bundling takes unnecessary time. Is this just how CDK works? Or do we have something configured incorrectly?
Copy code
...
Bundling asset BackendStack-sandbox/SharedStack/UserAuthStack/PreSignUpTrigger/Code/Stage...

  cdk.out/bundling-temp-e702d83a38335befa2ce80c0d9e739e24affb48fb1dbb835dfcc6cd7abc376aa/index.js  679.8kb

⚡ Done in 61ms
Bundling asset BackendStack-sandbox/SharedStack/UserAuthStack/CustomEmailTrigger/Code/Stage...

  cdk.out/bundling-temp-c0128579c2ed4649c49753439a981d8b34efb5f71f14c53bac46e41c9fd3d523/index.js  225.1kb
...
We're using 
@aws-cdk/aws-lambda-go
 and 
@aws-cdk/aws-lambda-nodejs
 if that changes anything
f
Hey @Chad (cysense), yeah that’s the way CDK work. Without bundling the code first, CDK wouldn’t know if the code has changed or not.
Btw, how many Nodejs functions do u have and how long do they take?
lambda-nodejs
functions are built using
esbuild
, they should be really fast.
c
Hey @Frank, thanks for the reply and for clarifying. I was hoping it would hash functions before bundling to determine if there were changes. But as long as its working as expected, I'll find other places to optimise 😛
Actually, now that you pointed it out, you are right. The nodejs functions are super quick, but 95% of our functions are Go and those are a few seconds each