- Create the project from the following template:
$ sls create --template-url https://github.com/danteinc/js-cloud-native-cookbook/tree/master/ch2/event-first --path cncb-event-first
- Navigate to the cncb-event-first directory with cd cncb-event-first.
- Review the file named serverless.yml with the following content:
service: cncb-event-firstprovider: name: aws runtime: nodejs8.10 iamRoleStatements: - Effect: Allow Action: - kinesis:PutRecord Resource: ${cf:cncb-event-stream-${opt:stage}.streamArn}functions: submit: handler: handler.submit environment: STREAM_NAME: ${cf:cncb-event-stream-${opt:stage}.streamName}
- Review the file named handler.js with the following content:
module.exports.submit = (thing, context, callback) ...