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/replaying-events --path cncb-replaying-events
  1. Navigate to the cncb-replaying-events directory with cd cncb-replaying-events.
  2. Review the file named ./lib/replay.js with the following content:
exports.command = 'replay [bucket] [prefix]'exports.desc = 'Replay the events in [bucket] for [prefix]'const _ = require('highland');const lodash = require('lodash');const aws = require('aws-sdk');aws.config.setPromisesDependency(require('bluebird'));exports.builder = {    bucket: {        alias: 'b',    },    prefix: {        alias: 'p',    },    function: {        alias: 'f',    },    dry: {        alias: 'd',        default: true, type: 'boolean' ...

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.