# KinesisEventSource

Use an Amazon Kinesis stream as an event source for AWS Lambda.

Extends: StreamEventSource › KinesisEventSource
Implements: IEventSource

- Source: [`aws-lambda-event-sources/lib/kinesis.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-lambda-event-sources/lib/kinesis.ts#L88)
- Type last changed: v2.77.0 · 26 Apr 2023

## Example

```ts
import * as kinesis from 'aws-cdk-lib/aws-kinesis';
import { KinesisEventSource } from 'aws-cdk-lib/aws-lambda-event-sources';

const stream = new kinesis.Stream(this, 'MyStream');

declare const myFunction: lambda.Function;
myFunction.addEventSource(new KinesisEventSource(stream, {
  batchSize: 100, // default
  startingPosition: lambda.StartingPosition.TRIM_HORIZON,
}));
```

## Initializer

```ts
new KinesisEventSource(stream: IStream, props: KinesisEventSourceProps)
```

## Properties

- `eventSourceMappingArn`: string — The ARN for this EventSourceMapping.

- `eventSourceMappingId`: string — The identifier for this EventSourceMapping.

- `stream`: [IStream](/cdk/api/v2/docs/aws-cdk-lib.aws_kinesis.IStream.html)

## Methods

- `bind(target: IFunction): void` — Called by `lambda.addEventSource` to allow the event source to bind to this function.
