Hi Ryan Thanks for making this great video. I wonder if I would like to use some 3rd party package like axios, is there any extra thing that I need to set it up in my stack.ts ? or it is enough that I just simply run npm install axios then import it in the handler?
Hey! I would suggest using a Lambda layer! More than likely, you will want to use Axios for multiple lambdas, so a shared Lambda layer would be a good solution for this. Shawn Torsitano has a fantastic breakdown of how to do this on his blog at: shawntorsitano.com/blog/cdk-lambda-layers/ I also have a video showing how to do it that you can check out. I have a link to my GitHub repo in the description that contains the code. If you don't want to worry about layers, you can also package your function as a Docker image. I hope this helps!
Which videos would you like to see me make next on this channel?
Hi Ryan Thanks for making this great video. I wonder if I would like to use some 3rd party package like axios, is there any extra thing that I need to set it up in my stack.ts ? or it is enough that I just simply run npm install axios then import it in the handler?
Hey!
I would suggest using a Lambda layer! More than likely, you will want to use Axios for multiple lambdas, so a shared Lambda layer would be a good solution for this. Shawn Torsitano has a fantastic breakdown of how to do this on his blog at: shawntorsitano.com/blog/cdk-lambda-layers/
I also have a video showing how to do it that you can check out. I have a link to my GitHub repo in the description that contains the code. If you don't want to worry about layers, you can also package your function as a Docker image.
I hope this helps!
@@cloudmancer Hey Ryan, thanks for the article . I am following your video series slowly but surely :)