Skip to content

seldebrings/sls-copy-stack-tables

Repository files navigation

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

About

Serverless plugin to copy all dynamodb tables in AWS stack from one stage to another

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published