StartingPosition
- class aws_cdk.aws_lambda.StartingPosition(*values)
Bases:
EnumThe position in the DynamoDB, Kinesis or MSK stream where AWS Lambda should start reading.
- ExampleMetadata:
infused
Example:
import aws_cdk.aws_dynamodb as dynamodb from aws_cdk.aws_lambda_event_sources import DynamoEventSource, SqsDlq # table: dynamodb.Table # fn: lambda.Function dead_letter_queue = sqs.Queue(self, "deadLetterQueue") fn.add_event_source(DynamoEventSource(table, starting_position=lambda_.StartingPosition.TRIM_HORIZON, batch_size=5, bisect_batch_on_error=True, on_failure=SqsDlq(dead_letter_queue), retry_attempts=10 ))
Attributes
- 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,
startingPositionTimestampmust also be set.
- LATEST
Start reading just after the most recent record in the shard, so that you always read the most recent data in the shard.
- TRIM_HORIZON
Start reading at the last untrimmed record in the shard in the system, which is the oldest data record in the shard.