From a41e38799ce88fc2c450147259bfb51e13fdd3ff Mon Sep 17 00:00:00 2001 From: Erik Erikson Date: Tue, 24 Jan 2017 15:01:02 -0800 Subject: [PATCH] Re-Add/Expand Docs for Stream Declaration --- docs/providers/aws/events/streams.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/docs/providers/aws/events/streams.md b/docs/providers/aws/events/streams.md index 9e506e3de..a30840f3c 100644 --- a/docs/providers/aws/events/streams.md +++ b/docs/providers/aws/events/streams.md @@ -12,8 +12,13 @@ layout: Doc # DynamoDB / Kinesis Streams -This setup specifies that the `compute` function should be triggered whenever the corresponding DynamoDB table is modified (e.g. a new entry is added). +This setup specifies that the `compute` function should be triggered whenever: + 1. the corresponding DynamoDB table is modified (e.g. a new entry is added). + 2. the Lambda checkpoint has not reached the end of the Kinesis stream (e.g. a new record is added). +The ARN for the stream can be specified as a string, the reference to the ARN of a resource by logical ID, or the import of an ARN that was exported by a different service or CloudFormation stack. + +This is shown in each of the valid **Note:** The `stream` event will hook up your existing streams to a Lambda function. Serverless won't create a new stream for you. ```yml @@ -22,6 +27,26 @@ functions: handler: handler.compute events: - stream: arn:aws:dynamodb:region:XXXXXX:table/foo/stream/1970-01-01T00:00:00.000 + - stream: + type: dynamodb + arn: + Fn::GetAtt: + - MyDynamoDbTable + - Arn + - stream: + type: dynamodb + arn: + Fn::ImportValue: MyExportedDynamoDbStreamArnId + - stream: + type: kinesis + arn: + Fn::GetAtt: + - MyKinesisStream + - Arn + - stream: + type: kinesis + arn: + Fn::ImportValue: MyExportedKinesisStreamArnId ``` ## Setting the BatchSize and StartingPosition