How to do it...

  1. Create the project from the following template:
$ sls create --template-url https://github.com/danteinc/js-cloud-native-cookbook/tree/master/ch2/micro-event-store --path cncb-micro-event-store
  1. Navigate to the cncb-micro-event-store directory with cd cncb-micro-event-store.
  2. Review the file named serverless.yml with the following content:
service: cncb-micro-event-storeprovider:  name: aws  runtime: nodejs8.10  iamRoleStatements:    - Effect: Allow      Action:        - dynamodb:PutItem        - dynamodb:Query      Resource:        Fn::GetAtt: [ Table, Arn ]  environment:    TABLE_NAME:      Ref: Tablefunctions:  listener:    handler: handler.listener    events:      - stream:          type: kinesis          ...  trigger:    handler: handler.trigger    events:      - stream:          type: dynamodb          arn: Fn::GetAtt: ...

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.