- Create the project from the following template:
$ sls create --template-url https://github.com/danteinc/js-cloud-native-cookbook/tree/master/ch8/backpressure-ratelimit --path cncb-backpressure-ratelimit
- Navigate to the cncb-backpressure-ratelimit directory with cd cncb-backpressure-ratelimit.
- Review the file named serverless.yml with the following content:
service: cncb-backpressure-ratelimit...functions: listener: handler: handler.listener timeout: 240 # headroom for retries events: - stream: batchSize: 1000 # / (timeout / 2) < write capacity ... environment: WRITE_CAPACITY_UNITS: 10 SHARD_COUNT: 1...resources: Resources: Table: Type: AWS::DynamoDB::Table Properties: ... ProvisionedThroughput: ... WriteCapacityUnits