How to do it...

  1. Create two projects from the following template:
$ sls create --template-url https://github.com/danteinc/js-cloud-native-cookbook/tree/master/ch2/bi-directional-sync --path cncb-1-bi-directional-sync$ sls create --template-url https://github.com/danteinc/js-cloud-native-cookbook/tree/master/ch2/bi-directional-sync --path cncb-2-bi-directional-sync
  1. Review the file named serverless.yml with the following content in each project:
service: cncb-1-bi-directional-syncprovider:  name: aws  runtime: nodejs8.10  iamRoleStatements:    ...  environment:    SERVERLESS_PROJECT: ${self:service}    ...functions:  command:    handler: handler.command  trigger:    handler: handler.trigger    events:      - stream:          type: dynamodb          ...  listener:    handler: handler.listener ...

Get JavaScript Cloud Native Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.