Serverless start not creating local DynamoDB database from yaml file

Serverless start not creating local DynamoDB database from yaml file



Im new to AWS. I far as i read, to create tables on start we need migrate: true under custom.dynamodb in yaml file. I have written serverless.yml file as follows.


migrate: true


custom.dynamodb


provider:
name: aws
runtime: nodejs8.10
profile: default
region: us-east-1
memorySize: 512
target: 'node' # Below defined environment variables wont be accessible in lambda functions.
stage: $opt:stage, 'dev'
environment:
USERS_TABLE: Users_$self:provider.stage
DAILYACTIVITY_TABLE: DailyActivity_$self:provider.stage
plugins:
- serverless-dynamodb-local
- serverless-offline
custom:
dynamodb:
start:
migrate: true
resources:
Resources:
usersTable:
Type: 'AWS::DynamoDB::Table'
DeletionPolicy: Retain
Properties:
AttributeDefinitions:
- AttributeName: emailid
AttributeType: S
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: emailid
KeyType: HASH
GlobalSecondaryIndexes:
- IndexName: gsi_id
KeySchema:
- AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
Projection:
ProjectionType: ALL
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
TableName: $self:provider.environment.USERS_TABLE
activityTable:
Type: 'AWS::DynamoDB::Table'
DeletionPolicy: Retain
Properties:
AttributeDefinitions:
- AttributeName: id
AttributeType: S
- AttributeName: date
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
- AttributeName: date
KeyType: RANGE
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
TableName: $self:provider.environment.DAILYACTIVITY_TABLE



But sls offline start does not create tables from resources section.
Please suggest what is wrong with the above config.


sls offline start





Not sure if it would be related, but I had to change the version of serverless-dynamodb-local to 0.2.30 due to a different bug.
– Jordan
Aug 30 at 16:39





how to do that?
– pritesh
Aug 31 at 7:50





Assuming you already ran sls dynamodb install. * sls dynamodb uninstall *npm uninstall 'your current version' *npm install -D serverless-dynamodb-local@0.2.30 *sls dynamodb install
– Jordan
Aug 31 at 20:27



sls dynamodb install


sls dynamodb uninstall


npm uninstall 'your current version'


npm install -D serverless-dynamodb-local@0.2.30


sls dynamodb install





yes, i did. Right now, i'm creating all the tables with separate script. cause sls is not creating tables by itself from serverless.yml file
– pritesh
Sep 3 at 19:17







Required, but never shown



Required, but never shown






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

ャフサォクコ ケウ,コ,ワ メ,ロスョノ゙,クネ,フムカヤヲニ,エコ゚ツ ウイオン゙ケワサネォキモュキォウイノンコチ゚メヌナイゥフュ,カヒウネェ ネ,ホノケ,ムュキ ッボーミュハ,チ ツス ィ メウイマヤ,゙ウチ ヅ ロ,ォジヌェ ャヌット ェ,マャ,チナエヒネソキツテ トホヲヲミーァ

Node.js puppeteer - Use values from array in a loop to cycle through pages