serverless-dynamodb-local icon indicating copy to clipboard operation
serverless-dynamodb-local copied to clipboard

Dynamo db Seed data insertion not working when deploying to aws

Open steel119 opened this issue 6 years ago • 2 comments

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?

steel119 avatar Jan 08 '19 15:01 steel119

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

philiiiiiipp avatar Mar 13 '19 09:03 philiiiiiipp

I was able to seed my online dynamodb instance with:

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

cadesalaberry avatar Jan 06 '20 13:01 cadesalaberry