1.0.2 • Published 5 years ago
serverless-copy-stack-tables v1.0.2
Serverless Copy Stack Tables
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-devInstall
$ npm install serverless-copy-stack-tablesAdd plugin to serverless.yml
..
plugins:
- serverless-copy-stack-tables
..Usage in command prompt
$ sls copy-stack-tables --target-stage dev --source-stage prod --overwrite-all-data falseOptions
--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. OptionalUsage on deployment
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
..