99x / serverless-dynamodb-local

Serverless Dynamodb Local Plugin - Allows to run dynamodb locally for serverless
MIT License
624 stars 234 forks source link

Dynamo db Seed data insertion not working when deploying to aws #198

Open steel119 opened 5 years ago

steel119 commented 5 years ago

I have a serverless framework and dynamo db in my local. I am trying to seed data . When i do 'sls offline start', seed data is getting inserted into my local dynamo db. but when i deploy it to aws using 'sls deploy'. i don't see the seed data getting inserted on aws dynamo db.

I am very new to serverless and this is my 1st serverless application and deployment . I am using 'serverless-offline' and 'serverless-dynamo db' .

Below is my configuration on serverless.yml

serverless-offline:
host: 0.0.0.0
  dynamodb:
    start:
      port: 8000
      inMemory: true
      migrate: true 
      seed: true
      convertEmptyValues: true
    seed:
      domain:
        sources:
          - table: ${self:custom.test}
            sources: [seed/test.json]

Above configuration is working good for local setup. When i run sls offline start, everything is working fine. But when i do 'sls depoly' . I don't see seed data in dynamo db tables on aws . Also wanted to know where can i see the json seed data file (test.json) on aws server. Does it automatically gets deployed to aws somewhere?

philiiiiiipp commented 5 years ago

I am not the maintainer of this package, but afaik it only seeds in your offline dynamodb.

cadesalaberry commented 4 years ago

I was able to seed my online dynamodb instance with:

sls dynamodb seed --online --region us-east-1