- Create the project from the following template:
$ sls create --template-url https://github.com/danteinc/js-cloud-native-cookbook/tree/master/ch5/cognito-authorizer --path cncb-cognito-authorizer
- Navigate to the cncb-cognito-authorizer directory with cd cncb-cognito-authorizer.
- Review the file named serverless.yml with the following content:
service: cncb-cognito-authorizerprovider: name: aws # cfnRole: arn:aws:iam::<account-number>:role/${opt:stage}-cfnRole ...functions: hello: handler: handler.hello events: - http: ... authorizer: arn: ${cf:cncb-cognito-pool-${opt:stage}.userPoolArn}
- Install the dependencies with npm install.
- Run the tests with npm test -- -s $MY_STAGE.
- Review the contents generated in the .serverless ...