1.0.2 • Published 3 years ago

serverless-copy-stack-tables v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

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-dev

Install

$  npm install serverless-copy-stack-tables

Add 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 false

Options

--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

Usage 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
  ..