简体   繁体   中英

Can aws-sdk be a development dependency when developing lambdas with NodeJS?

I am quite new in trying to develop lambdas with NodeJs, so this question might sound silly.

One of the limitations of lambdas is the size of the function / dependencies (250 MB) and I was wondering if aws-sdk (which has >45 MB)can be treated as a dev-dependency since it occupies 1/5 of the total size of a lambda.

I understand that this is required during development, but is it not the case that this already exists in the lambda container once deployed to AWS?

Any suggestion would help as all the articles that I browsed seem to install it as a prod dependency.

Absolutely, the aws-sdk is available by default as an NPM dependency inside of the lambda containers so if you leave it as a development dependency your code will still work inside of lambda.

Here you can see which lambda containers contain which version of the AWS SDK. So in case you really need a specific version or one that's not yet loaded onto the lambda containers, you can manually include your own.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM