Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 56308ce

Browse filesBrowse files
authored
Merge pull request awsdocs#36 from Tail-wind/master
Poller behaviour clarification
2 parents f29214f + 2406c4b commit 56308ce
Copy full SHA for 56308ce

File tree

Expand file treeCollapse file tree

1 file changed

+5
-8
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-8
lines changed

‎doc_source/with-kinesis.md

Copy file name to clipboard
+5-8Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
# Using AWS Lambda with Kinesis<a name="with-kinesis"></a>
22

3-
You can create a Kinesis stream to continuously capture and store terabytes of data per hour from hundreds of thousands of sources such as website click streams, financial transactions, social media feeds, IT logs, and location\-tracking events\. For more information, see [Kinesis](https://aws.amazon.com/kinesis/)\.
3+
You can create a Kinesis stream to continuously capture and store terabytes of data per hour from hundreds of thousands of sources such as website click streams, financial transactions, social media feeds, IT logs, and location\-tracking events\. For more information, see [Kinesis](https://aws.amazon.com/kinesis/)\.
44

55
You can subscribe Lambda functions to automatically read batches of records off your Kinesis stream and process them if records are detected on the stream\. AWS Lambda then polls the stream periodically \(once per second\) for new records\.
66

77
Note the following about how the Kinesis and AWS Lambda integration works:
8-
+ **Stream\-based model** – This is a model \(see [Event Source Mapping](invocation-options.md#intro-invocation-modes)\), where AWS Lambda polls the stream and, when it detects new records, invokes your Lambda function by passing the new records as a parameter\.
8+
+ **Stream\-based model** – This is a model \(see [Event Source Mapping](invocation-options.md#intro-invocation-modes)\), where AWS Lambda polls the stream and, when it detects new records, invokes your Lambda function by passing the new records as a parameter\.
99

10-
In a stream\-based model, you maintain event source mapping in AWS Lambda\. The event source mapping describes which stream maps to which Lambda function\. AWS Lambda provides an API \([CreateEventSourceMapping](API_CreateEventSourceMapping.md)\) that you can use to create the mapping\. You can also use the AWS Lambda console to create event source mappings\.
11-
+ **Synchronous invocation** – AWS Lambda invokes a Lambda function using the `RequestResponse` invocation type \(synchronous invocation\) by polling the Kinesis Stream\. For more information about invocation types, see [Invocation Types](invocation-options.md)\.
10+
In a stream\-based model, you maintain event source mapping in AWS Lambda\. The event source mapping describes which stream maps to which Lambda function\. AWS Lambda provides an API \([CreateEventSourceMapping](API_CreateEventSourceMapping.md)\) that you can use to create the mapping\. You can also use the AWS Lambda console to create event source mappings\.
11+
+ **Synchronous invocation** – AWS Lambda invokes a Lambda function using the `RequestResponse` invocation type \(synchronous invocation\) by polling the Kinesis Stream\. For more information about invocation types, see [Invocation Types](invocation-options.md)\.
1212
+ **Event structure** – The event your Lambda function receives is a collection of records AWS Lambda reads from your stream\. When you configure event source mapping, the batch size you specify is the maximum number of records that you want your Lambda function to receive per invocation\.
1313

1414
While AWS Lambda will only poll for records once per second, it can be invoked multiple times per second provided that:
15-
+ There were more records retrieved during the poll than the batch size will allow for a single invocation\.
16-
+ The processing time for the function allowed it to complete before 1 second had elapsed\.
1715

18-
This means that the limiting factor on how many records your function can process is defined by how quickly it can process records, not how often Lambda polls for new records\.
1916

2017
Regardless of what invokes a Lambda function, AWS Lambda always executes a Lambda function on your behalf\. If your Lambda function needs to access any AWS resources, you need to grant the relevant permissions to access those resources\. You also need to grant AWS Lambda permissions to poll your Kinesis stream\. You grant all of these permissions to an IAM role \(execution role\) that AWS Lambda can assume to poll the stream and execute the Lambda function on your behalf\. You create this role first and then enable it at the time you create the Lambda function\. For more information, see [Manage Permissions: Using an IAM Role \(Execution Role\)](intro-permission-model.md#lambda-intro-execution-role)\.
2118

@@ -29,4 +26,4 @@ The following diagram illustrates the application flow:
2926

3027
1. AWS Lambda executes the Lambda function by assuming the execution role you specified at the time you created the Lambda function\.
3128

32-
For a tutorial that walks you through an example setup, see [Tutorial: Using AWS Lambda with Kinesis](with-kinesis-example.md)\.
29+
For a tutorial that walks you through an example setup, see [Tutorial: Using AWS Lambda with Kinesis](with-kinesis-example.md)\.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.