Speed up aws-lambda-nodejs build when dealing with multiple stacks and a lot of lambdas (+150) #20290
Replies: 3 comments
-
This has been brought up several times in the past. Last I believe it was broached, the result was that this isn't a super high priority. |
Beta Was this translation helpful? Give feedback.
-
I found a solution by myself: handling a parallel build of all my lambdas using esbuild with a cache (~20 seconds for 140 lambdas). And then deploying it using CDK. I can't publish any code, but the system is about having a build script that uses esbuild and saves the lambdas in a build directory. To reduce build time, have a kind of a system that links the builds to the directories that changed. Do the checksums of the directories and rebuild the lambdas if it changed. |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm using CDK for development on a microservices architecture.
I have 11 services on different stacks and a total of 160 lambda functions.
When I need to test a change in my code, I redeploy one stack using the
--hotswap
parameter.But as aws-lambda-nodejs builds the code before starting to synthesize the stack, it compliles all the 160 lambdas before deploying my single lambda - which takes 90-120 secondes at each deployment - 30-40 times per day.
I can see two way to optimise this:
Is there any tool / method / option / idea that would allow me to optimize this ?
Beta Was this translation helpful? Give feedback.
All reactions