enum StartingPosition
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Lambda.StartingPosition |
Java | software.amazon.awscdk.services.lambda.StartingPosition |
Python | aws_cdk.aws_lambda.StartingPosition |
TypeScript (source) | @aws-cdk/aws-lambda » StartingPosition |
The position in the DynamoDB, Kinesis or MSK stream where AWS Lambda should start reading.
Example
import { Secret } from '@aws-cdk/aws-secretsmanager';
import { SelfManagedKafkaEventSource } from '@aws-cdk/aws-lambda-event-sources';
// The list of Kafka brokers
const bootstrapServers = ['kafka-broker:9092'];
// The Kafka topic you want to subscribe to
const topic = 'some-cool-topic';
// The secret that allows access to your self hosted Kafka cluster
declare const secret: Secret;
declare const myFunction: lambda.Function;
myFunction.addEventSource(new SelfManagedKafkaEventSource({
bootstrapServers: bootstrapServers,
topic: topic,
secret: secret,
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. |
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.