Figure 17.3 explains the way a custom application writes a record to a Kinesis stream and the way Lambda polls the stream:
Figure 17.3: Event source mapping for AWS stream-based services
Reference URL: https://docs.aws.amazon.com/lambda/latest/dg/images/kinesis-pull-10.png
The steps for the preceding figure are as follows:
- The custom application writes records to an Amazon Kinesis stream.
- At the same time, AWS Lambda continuously keeps polling the stream. As soon as it detects a new record on the stream, it invokes the AWS Lambda function. Based on the event configuration, it decides which Lambda function is to execute against which event source.
- It verifies that the attached IAM permission policy to the Lambda function allows it to poll the stream. If it is not true, then the AWS Lambda function is not invoked.