class KinesisConsumerEventSource
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Lambda.EventSources.KinesisConsumerEventSource |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awslambdaeventsources#KinesisConsumerEventSource |
![]() | software.amazon.awscdk.services.lambda.eventsources.KinesisConsumerEventSource |
![]() | aws_cdk.aws_lambda_event_sources.KinesisConsumerEventSource |
![]() | aws-cdk-lib » aws_lambda_event_sources » KinesisConsumerEventSource |
Implements
IEvent
Extends
Stream
Use an Amazon Kinesis stream consumer as an event source for AWS Lambda.
Example
import * as kinesis from 'aws-cdk-lib/aws-kinesis';
import { KinesisConsumerEventSource } from 'aws-cdk-lib/aws-lambda-event-sources';
const stream = new kinesis.Stream(this, 'MyStream');
const streamConsumer = new kinesis.StreamConsumer(this, 'MyStreamConsumer', {
stream,
streamConsumerName: 'MyStreamConsumer',
});
declare const myFunction: lambda.Function;
myFunction.addEventSource(new KinesisConsumerEventSource(streamConsumer, {
batchSize: 100, // default
startingPosition: lambda.StartingPosition.TRIM_HORIZON,
}));
Initializer
new KinesisConsumerEventSource(streamConsumer: IStreamConsumer, props: KinesisEventSourceProps)
Parameters
- streamConsumer
IStream
Consumer - props
Kinesis
Event Source Props
Properties
Name | Type | Description |
---|---|---|
event | string | The ARN for this EventSourceMapping. |
event | string | The identifier for this EventSourceMapping. |
stream | IStream |
eventSourceMappingArn
Type:
string
The ARN for this EventSourceMapping.
eventSourceMappingId
Type:
string
The identifier for this EventSourceMapping.
streamConsumer
Type:
IStream
Methods
Name | Description |
---|---|
bind(target) | Called by lambda.addEventSource to allow the event source to bind to this function. |
bind(target)
public bind(target: IFunction): void
Parameters
- target
IFunction
Called by lambda.addEventSource
to allow the event source to bind to this function.