99x / serverless-dynamodb-client Goto Github PK
View Code? Open in Web Editor NEWServerless Dynamodb Client to automatically switch between AWS and Local instances
License: MIT License
Serverless Dynamodb Client to automatically switch between AWS and Local instances
License: MIT License
Hey there!
I get a "TypeError: Plugin is not a constructor" when trying to run serverless offline start
with serverless-dynamodb-client plugin enabled.
Version I used:
On top of that I use typescript.
Thanks for the help
Add CONTRIBUTING.md
Please allow the port (8000) to be overridden via an environment variable, to make running multiple related services on the same machine easier.
Thanks!
Add CODE_OF_CONDUCT.md
It would be handy to allow using custom options when constructing a DynamoDB object.
For start it would be nice to support defining convertEmptyValues
and port
in serverless.yml
.
Using this library doesn't seem to play nicely in the Lambda Node 18 runtime.
{ "errorType": "Runtime.ImportModuleError", "errorMessage": "Error: Cannot find module 'aws-sdk'\nRequire stack:\n- /var/task/node_modules/serverless-dynamodb-client/index.js\n- /var/task/handlers/profile.js\n- /var/runtime/index.mjs", "stack": [ "Runtime.ImportModuleError: Error: Cannot find module 'aws-sdk'", "Require stack:", "- /var/task/node_modules/serverless-dynamodb-client/index.js", "- /var/task/handlers/profile.js", "- /var/runtime/index.mjs", " at _loadUserApp (file:///var/runtime/index.mjs:1087:17)", " at async UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1119:21)", " at async start (file:///var/runtime/index.mjs:1282:23)", " at async file:///var/runtime/index.mjs:1288:1" ] }
This may need to be adjusted to import DynamoDB in a way that's compatible with aws-sdk v3
https://github.com/aws/aws-sdk-js-v3
Hi,
Since the AWS SDK is available in the AWS Lambda execution environment, the aws-sdk
package could be added to devDependencies
instead, in order to reduce the package size.
What do you think?
Suppose you have configured plugins serverless-dynamodb-local
, serverless-offline
and serverless-dynamodb-client
. Then, you execute commands
$ sls offline &
[1]
$ sls invoke local -f function --path input.json
[2]
The AWS dynamodb instance will be used, not the local one.
The reason is that:
IS_OFFLINE
not to the parent shell but to the sls offline
processIS_OFFLINE
defined. So, when require('serverless-dynamodb-client')
is called, isOffline()
always returns false.Execute
$ export IS_OFFLINE=true
before command [2]
The plugin doesn't detect local environments anymore because the IS_OFFLINE
flag has been removed. See dherault/serverless-offline#768 (comment)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.