Claudia requires aws-sdk dependency, AWS does not
See original GitHub issue- Expected behaviour:
Claudia should create
or update
a function that uses aws-sdk
without it being installed in node_modules
, especially when using the --use-local-dependencies
flag.
Lambda provides this dependency as part of the environment, so not installing it saves lambda disk space, and this practice is encouraged by Amazon. Clauda should not require that it is installed.
- What actually happens:
Error: Cannot find module 'aws-sdk'
...
cannot require ./lambda after clean installation. Check your dependencies.
- Steps to reproduce the problem:
Use aws-sdk
as a devDependency
, and try to update.
Issue Analytics
- State:
- Created 7 years ago
- Comments:34 (14 by maintainers)
Top Results From Across the Web
claudiajs/claudia - Gitter
Hi, I upgraded npm and claudia in a codebase that has worked fine, and now I get a problem where during claudia package...
Read more >Lambda function does not automatically set aws-sdk ...
The first option doesn't work because it omits all dependencies, even those not in the default Lambda runtime environment.
Read more >Using claudia.js to send emails using AWS Lambda
TLDR; This post explains how to use claudia.js to send emails via AWS Lambda using AWS Simple Email Service. In a previous post...
Read more >The AWS SDK for Java 2.17 removes its external dependency ...
x no longer requires an external copy of Jackson-databind, Jackson-core, or Jackson-dataformat-cbor in order to function. This release does not ...
Read more >Installing and configuring Claudia.js
How to set up Claudia.js and configure credentials for deploying AWS Lambda ... so it does not introduce any runtime dependencies — so...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m sure there are several solutions I as an app developer can implement to make a Lambda claudia-complaint. My point was that claudia should be able to handle any node lambda that runs in AWS. There shouldn’t be claudia-specific constraints. Its your tool and you can decide that this case is too much work for Claudia to try to tackle.
It’s just a little surprising to read that, and then read that I need to write special code for an otherwise functional lambda to be deployed using Claudia.
Claudia uses its dependencies locally, and you should not include Claudia as a production dependency, only as a development one. Claudi Bot builder does not use aws-sdk, so it does not need it.
If your code requires aws-sdk, and you do not want to deploy it, use it as an optional dependency (
npm install aws-sdk -O
) and then deploy using--no-optional-dependencies
, this will exclude AWS SDK from the final package.--use-local-dependencies
just copies whatever you have locally. It’s your job then to make sure development dependencies are not installed.