- Create the project from the following template:
$ sls create --template-url https://github.com/danteinc/js-cloud-native-cookbook/tree/master/ch2/materialized-view-es --path cncb-materialized-view-es
- Navigate to the cncb-materialized-view-es directory with cd cncb-materialized-view-es.
- Review the file named serverless.yml with the following content:
service: cncb-materialized-view-esprovider: name: aws runtime: nodejs8.10 iamRoleStatements: ... environment: DOMAIN_ENDPOINT: Fn::GetAtt: [ Domain, DomainEndpoint ]...functions: listener: handler: handler.listener events: - stream: type: kinesis arn: ${cf:cncb-event-stream-${opt:stage}.streamArn} ... search: handler: handler.searchresources: Resources: Domain: Type: AWS::Elasticsearch::Domain ...