Comments (13)
This is a good suggestion. The challenge we need to solve is we need to create the local dynamodb tables also from the defined schema. @jbremmer Any suggestions?
from serverless-dynamodb-local.
Not sure what you mean, I would not want to have two definitions. YAML one is what I would want to work with possibly extending a custom section with seed file pointer.
from serverless-dynamodb-local.
I've created a branch that uses the serverless.yml Resources section for creation of DynamoDB tables here: https://github.com/msjonker/serverless-dynamodb-local/tree/serverless-config
Unfortunately, since dynamodb-migrations is no longer used, seeding is not available. @AshanFernando if you could provide some feedback, I'd appreciate it.
from serverless-dynamodb-local.
@msjonker I think we can replace dynamodb-migrations with a new library called dynamodb-seeds, only with seeds functionality. What do you think?
from serverless-dynamodb-local.
Thanks for the feedback!
I can't find dynamodb-seeds; did you mean dynamo-seeder? If so, that library depends on a schema file existing for each table that is being seeded, which gets us back to where we were with a separate schema file having to be updated in tandem with the Serverless Resources definition.
To me, it feels that seeding should be separate from this plugin, as seeding could be used both for local or production instance of DynamoDB. It looks like this was attempted at one point in https://github.com/marc-hughes/serverless-dynamodb-fixtures-plugin, but has not been updated to work with Serverless v1+. What is described there is more like I was thinking. I don't use the seeding functionality of serverless-dynamodb-local, but would be willing to see what it takes to get that plugin up-to-date, if you are open to that solution.
from serverless-dynamodb-local.
Hi @msjonker, even now serverless-dynamodb-local supports seeding in local as well as production environments. However the feature was missing in the documentation after creating a new branch for the serverless 1.0 version of the plugin. This we could fix easily. @mjzone Will you be able to look into this?
I agree with you. Seeding should be separated from the migration plugin. Since the migration feature is moving to yml, migration plugin is no longer needed. Now migrations more becoming a part of serverless (Previously we wrote functionality as third party plugins if its not depending on serverless structure).
So my proposal is to create a new plugin called dynamodb-seeds extracting the seeding functionality from dynamodb-migrations(Both local and production seeding) and use with serverless-dynamodb-local to make the plugin up-to date with both yml based migrations and seeding functionality.
So shall we move on that directions so that we can update the plugins?
from serverless-dynamodb-local.
Yep, sounds good!
from serverless-dynamodb-local.
I currently use serverless variables like so
serverless.yaml
resources:
Resources:
myTable:
Type: AWS::DynamoDB::Table
Properties:
${file(./dynamodb/my-table.json):Table}
from serverless-dynamodb-local.
Where did you guys get to with this work? It seems like the the right approach to take
from serverless-dynamodb-local.
I believe that the dynamodb-seeds plugin needs to be created. I haven't had a chance to work on that yet.
from serverless-dynamodb-local.
I reviewed, and tested this, works great and looks good!
I rebased it on top of v1, and pushed to my repo. Let me know if I can further help to get this merged.
from serverless-dynamodb-local.
This has been merged, and should be closed.
from serverless-dynamodb-local.
Resources declaration addressed in #72. Seeding addressed in #77.
from serverless-dynamodb-local.
Related Issues (20)
- DynamoDB Local throwing NetworkingError HOT 5
- Windows: Serverless command "dynamodb install" not found. HOT 8
- Deprecation warning: CLI options definitions were upgraded with "type" property HOT 6
- Global Secondary Index is not working HOT 3
- WSL2 Unable to start DynamoDB Local process! HOT 2
- Cannot launch DynamoDB on Mac M1 architecture HOT 15
- Getting "UnknownError: Service Unavailable" while trying to run the local server using command "sls dynamodb start"
- Plugin not working after upgrading to SLS v3 HOT 2
- Can I upgrade schemas?
- Issue with default region on Localstack 1.1
- CLI_OPTIONS_SCHEMA_V3 deprecation support
- Semantic version inconsistency HOT 1
- Create table for offline mode only
- Unexpected key `ContributorInsightsSpecification` HOT 2
- migrate does not work with higher version of node over 16 HOT 4
- sls dynamodb install failing to download HOT 1
- Error getting DynamoDb local latest tar.gz location undefined: 403 HOT 30
- Please deploy the new version that fixes the http -> https thing on the dynamodb-local package. HOT 1
- Invalid AWS Mock Access Key ID through a new AWS-SDK version HOT 5
- The latest version installed by npm is different than what is in the repo HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serverless-dynamodb-local.