enum StartingPosition
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Lambda.StartingPosition |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awslambda#StartingPosition |
![]() | software.amazon.awscdk.services.lambda.StartingPosition |
![]() | aws_cdk.aws_lambda.StartingPosition |
![]() | aws-cdk-lib » aws_lambda » StartingPosition |
The position in the DynamoDB, Kinesis or MSK stream where AWS Lambda should start reading.
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,
}));
Members
Name | Description |
---|---|
TRIM_HORIZON | Start reading at the last untrimmed record in the shard in the system, which is the oldest data record in the shard. |
LATEST | Start reading just after the most recent record in the shard, so that you always read the most recent data in the shard. |
AT_TIMESTAMP | Start reading from a position defined by a time stamp. |
TRIM_HORIZON
Start reading at the last untrimmed record in the shard in the system, which is the oldest data record in the shard.
LATEST
Start reading just after the most recent record in the shard, so that you always read the most recent data in the shard.
AT_TIMESTAMP
Start reading from a position defined by a time stamp.
Only supported for Amazon Kinesis streams, otherwise an error will occur.
If supplied, startingPositionTimestamp
must also be set.