{"_id":"dynamo-replicator","_rev":"43-a8e5325ece510fa163e9b9efb7e86355","name":"dynamo-replicator","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"dynamo-replicator","version":"1.0.0","_id":"dynamo-replicator@1.0.0","maintainers":[{"name":"financial-times","email":"strategic.products@ft.com"}],"dist":{"shasum":"9a335ceff72a1510ec0215676d21fdc6a301b2b8","tarball":"https://registry.npmjs.org/dynamo-replicator/-/dynamo-replicator-1.0.0.tgz","integrity":"sha512-vElYBV6DB6yC2PWV7me+ywuc3eT4vA/myTvpZ8ue3/4rzuESyHpMlxIYPxwda3AvzHijxNF396j8uxtrfbY+sQ==","signatures":[{"sig":"MEYCIQCFH+VZg/Y/yJzW/EdMTugcBqNFnFR71k78G+Mrsk3MxAIhAOnHh09cbroVrgecuWZJaks/eh57PFQeId1AyV1bU1W/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"replactor.js","_from":".","_shasum":"9a335ceff72a1510ec0215676d21fdc6a301b2b8","gitHead":"ba711b4adc4ae2cfb8e66c359846fb3133c418b5","scripts":{},"_npmUser":{"name":"financial-times","email":"strategic.products@ft.com"},"_npmVersion":"2.14.12","description":"Lambda-ready npm package for replicating DynamoDB tables within or between regions.","directories":{},"_nodeVersion":"4.2.6","dependencies":{"aws-sdk":"^2.2.33","denodeify":"^1.2.1","es6-promise":"^3.0.2"}},"1.0.1":{"name":"dynamo-replicator","version":"1.0.1","_id":"dynamo-replicator@1.0.1","maintainers":[{"name":"financial-times","email":"strategic.products@ft.com"}],"dist":{"shasum":"9226cfb24c1836538d8588253eb64feab761733f","tarball":"https://registry.npmjs.org/dynamo-replicator/-/dynamo-replicator-1.0.1.tgz","integrity":"sha512-QIjCqtqZX2MrZ3FI5vh/Zgi5fUDMlUPohlAuKS1Jd9YtApebLfFE1pIm2O+Q8Ftnz3O/JrItBlB4IUc1obzSsw==","signatures":[{"sig":"MEQCIFuJaS6BtmQjPRA3mYLBxCOITmhHWyKBYRDbkGxWnuIaAiBXFYrxAS4XqZ1B7TXWhGz4YDWqP85aGQmNg5kRAKTYHw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"replicator.js","_from":".","_shasum":"9226cfb24c1836538d8588253eb64feab761733f","gitHead":"e4369d25bf9882abe20b3ae1b3242b80da4dab71","scripts":{},"_npmUser":{"name":"financial-times","email":"strategic.products@ft.com"},"_npmVersion":"2.14.12","description":"Lambda-ready npm package for replicating DynamoDB tables within or between regions.","directories":{},"_nodeVersion":"4.2.6","dependencies":{"aws-sdk":"^2.2.33","denodeify":"^1.2.1","es6-promise":"^3.0.2"}},"1.0.2":{"name":"dynamo-replicator","version":"1.0.2","_id":"dynamo-replicator@1.0.2","maintainers":[{"name":"financial-times","email":"strategic.products@ft.com"}],"dist":{"shasum":"2699ab54859157303dbc7068db28fdbd27ef911b","tarball":"https://registry.npmjs.org/dynamo-replicator/-/dynamo-replicator-1.0.2.tgz","integrity":"sha512-ZQSob2AteDpSCrVr4fL5UmxR/Vi2O0VhkakBxrMX5iQHRAQI4mNrnqw8H3+YX1psz8nOqi2A/LlFdDcPNoPu4Q==","signatures":[{"sig":"MEUCIQD4WfYEan2bAhj1qxqL2Z/tokAp/4oUR9DuGl3IEiDAyAIgETzIskYq6d12QhwEr/+ZvJ2q8aWngMjRefo7ii7OJk0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2pE0CRA9TVsSAnZWagAAW0AQAILony8v+MUhN23yB46q\nw/oBiGoacTA4rteEktivIYF5vJ95i+Nz9ufchxTCcmdYcdha6gUFQ56QvMI2\nNrEs7k/aoZNrtqJlhG8Vaw0r6i70hE95pg4sq8XRLP6QNNk0i5m/0EIB98ea\n30ZHumr3LGQ+S4TmWEttXI2tTRAn1UF8WiRg0xCN0CDVFlbkYXOXfOP6EsM/\nXrcxmL1sJPEj5z8GTc1oVOavNNQxe709csPK7ILiib5V61jfBICTXJxe1tIi\ngHwN1HEbeBYjozv8UpyF9b9AI+Y2zd9WAhJFDudmqzUKZuWcRwDnP1j0kQDA\nd8iN8BebgoJEEOi0Kjdyn//OjzABNWeWoRj6VKfrBg4DLeHVQV0vgXVpVxMX\nbIjbBxm6H9ov2MU55/Al8qiu35NdbugGMBaK9pSpRSC/t3O5AlsdnqvENNQ/\nkCaf/NCMY9z+BroJ4hFZq7cnDf15ij+Ql5jKQlSgBu2rEZaFopsB39Qe4Irn\nptP2kjzAu//XwhLa0SNcFDwHNlNvoX625HbvD6DnJ1AWKVJucrvj7BnPslpd\niYZykp7smdjbijV+Dga2pr9NnidI8S7s98ies3Wz3i7isDsLbKDcK1mGI9HP\nbv4MvPyhx43dZ6J3L4oPnHpZYk1xTlkYPDIf8A/P/5QbA6i+Jpjm4XI3U+T6\nxH9y\r\n=dMJm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"replicator.js","_from":".","_shasum":"2699ab54859157303dbc7068db28fdbd27ef911b","gitHead":"af0966e481f511cc684b14831e180ecf18d43c57","scripts":{"test":"mocha"},"_npmUser":{"name":"financial-times","email":"strategic.products@ft.com"},"_npmVersion":"2.14.12","description":"Lambda-ready npm package for replicating DynamoDB tables within or between regions.","directories":{},"_nodeVersion":"4.2.6","dependencies":{"aws-sdk":"^2.2.33","denodeify":"^1.2.1"},"devDependencies":{"chai":"^3.5.0","mocha":"^2.4.5","rewire":"^2.5.1"}}},"time":{"created":"2016-01-30T10:54:25.110Z","modified":"2026-06-23T16:04:36.224Z","1.0.0":"2016-01-30T10:54:25.110Z","1.0.1":"2016-01-30T10:56:56.295Z","1.0.2":"2016-01-30T19:02:13.378Z"},"description":"Lambda-ready npm package for replicating DynamoDB tables within or between regions.","maintainers":[{"email":"code.management@ft.com","name":"the-ft"},{"email":"info+npm@rowanmanning.com","name":"rowanmanning"},{"email":"yay@chee.party","name":"chee"},{"email":"a@ax.gy","name":"alexwilson"},{"email":"howdy@aendra.com","name":"aendra"},{"email":"emma.lewis@ft.com","name":"emmalewis"},{"email":"lee@leemoody.co.uk","name":"notlee"},{"email":"hamza.samih@ft.com","name":"hamza.samih"},{"email":"robert.boulton@ft.com","name":"robertboulton"},{"email":"leila.micollier@ft.com","name":"leila.micollier"},{"email":"rob.godfrey@ft.com","name":"robgodfrey"}],"readme":"# DynamoDB Replicator\n\nLambda-ready npm package for replicating DynamoDB tables within or between regions.\n\nSupports one-way replication (single master to slave(s))\n\n## Usage\n\n### Prerequisites\n\nYou'll need NodeJS and NPM installed on your local machine.\n\n### Prepare your DynamoDB table\n\nAdd a stream to the DynamoDB table you want to use as your master.\n\n1. In the Overview tab of the DynamoDB table in the AWS console click **Manage Stream**.\n1. In the overlay that pops up choose **New Image** (although **New and old images** should also work should you need that for other reasons).\n1. Click **Enable**.\n\nAlternatively, if you want to provision your DynamoDB table with CloudFormation add the `StreamSpecification` property to the `AWS::DynamoDB::Table` object, e.g.\n\n```json\n{\n  \"AWSTemplateFormatVersion\": \"2010-09-09\",\n  \"Resources\": {\n    \"myTable\": {\n      \"TableName\": \"mytable\",\n      \"StreamSpecification\": {\n        \"StreamViewType\": \"NEW_IMAGE\"\n      }\n    }\n  }\n}\n```\n\n### Create the replication Lambda function\n\n1. Create a new empty directory on your computer\n1. Within that folder create two files, one called `package.json` and another called `index.js`.\n1. Edit `package.json` and save `{}` as the contents of that file.\n1. In your terminal type `npm install --save dynamo-replicator es6-promise`\n1. Edit `index.js` and save the contents of the file shown below (changing `SLAVE-REGION` and `SLAVE-TABLE` to be the region and table name of the DynamoDB to be replicated to).\n1. zip the contents of the folder up.\n1. Create a new Lambda function with a role that has sufficient IAM permissions (as a minimum it needs `dynamodb::PutItem` and `dynamodb::DeleteItem` on the **slave** table.\n1. On the **Triggers** tab of your **master** DynamoDB, click **Create Trigger** and **New Function**; for the **Configure event source** options, ensure the **DynamoDB table** is your master table and leave everything else as default and click **Next**; for the **Configure function** options name your function something like `dynamodb-replicator` and for **Code entry type** select **Upload a .ZIP file** and choose the zip file created earlier.\n1. Repeat the previous step for multiple slaves changing `SLAVE-REGION` and `SLAVE-TABLE` in `index.js` each time and re-zipping for each slave.\n1. Test by creating and deleting items from the **master** table and ensuring that the slaves update accordingly.\n\n**Contents of `index.json`**:\n```js\n'use strict';\n\nrequire('es6-promise').polyfill();\n\nvar replicator = require('dynamo-replicator')({\n\tregion: 'SLAVE-REGION',\n\ttable: 'SLAVE-TABLE'\n});\n\nexports.handler = function(event, context) {\n\treplicator.process(event)\n\t\t.then(function() {\n\t\t\tcontext.succeed('success');\n\t\t})\n\t\t.catch(function(err) {\n\t\t\tcontext.fail(err);\n\t\t});\n};\n```\n","readmeFilename":"README.md"}