Serverless framework plugin for copying all dynamoDB tables in AWS stack from one stage to another. Currently only works within the same region. Table names must use the standard naming convention:
TableName: mytablename-${opt:stage, self:provider.stage} # ex mytablename-dev
$ npm install serverless-copy-stack-tables
..
plugins:
- serverless-copy-stack-tables
..
$ sls copy-stack-tables --target-stage dev --source-stage prod --overwrite-all-data false
--target-stage Stage to copy to. Required
--source-stage Stage to copy from. Required
--overwrite-all-data Overwrite all items in table or update, default is false. Optional
custom:
..
# Copy all databases from prod stage when deploying to the staging stage
copyDataDeploy:
targetStage: staging #Required
sourceStage: prod #Required
overwriteAllData: true #Optional, default is false
..