- Create the project from the following template:
$ sls create --template-url https://github.com/danteinc/js-cloud-native-cookbook/tree/master/ch3/saga --path cncb-saga
- Navigate to the cncb-saga directory with cd cncb-sage.
- Review the file named serverless.yml with the following content:
service: cncb-sagaprovider: name: aws runtime: nodejs8.10 iamRoleStatements: ... environment: TABLE_NAME: Ref: Tablefunctions: submit: handler: handler.submit trigger: handler: handler.trigger events: - stream: type: dynamodb arn: Fn::GetAtt: [ Table, StreamArn ] ... environment: STREAM_NAME: ${cf:cncb-event-stream-${opt:stage}.streamName} listener: handler: handler.listener events: - stream: type: kinesis arn: ${cf:cncb-event-stream-${opt:stage}.streamArn} ...