Class KinesisEventSource.Builder
java.lang.Object
software.amazon.awscdk.services.lambda.eventsources.KinesisEventSource.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<KinesisEventSource>
- Enclosing class:
KinesisEventSource
@Stability(Stable)
public static final class KinesisEventSource.Builder
extends Object
implements software.amazon.jsii.Builder<KinesisEventSource>
A fluent builder for
KinesisEventSource
.-
Method Summary
Modifier and TypeMethodDescriptionThe largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function.bisectBatchOnError
(Boolean bisectBatchOnError) If the function returns an error, split the batch in two and retry.build()
static KinesisEventSource.Builder
If the stream event source mapping should be enabled.maxBatchingWindow
(Duration maxBatchingWindow) The maximum amount of time to gather records before invoking the function.maxRecordAge
(Duration maxRecordAge) The maximum age of a record that Lambda sends to a function for processing.onFailure
(IEventSourceDlq onFailure) An Amazon SQS queue or Amazon SNS topic destination for discarded records.parallelizationFactor
(Number parallelizationFactor) The number of batches to process from each shard concurrently.reportBatchItemFailures
(Boolean reportBatchItemFailures) Allow functions to return partially successful responses for a batch of records.retryAttempts
(Number retryAttempts) Maximum number of retry attempts Valid Range: * Minimum value of 0 * Maximum value of 10000.startingPosition
(StartingPosition startingPosition) Where to begin consuming the stream.tumblingWindow
(Duration tumblingWindow) The size of the tumbling windows to group records sent to DynamoDB or Kinesis Valid Range: 0 - 15 minutes.
-
Method Details
-
create
- Parameters:
stream
- This parameter is required.- Returns:
- a new instance of
KinesisEventSource.Builder
.
-
startingPosition
@Stability(Stable) public KinesisEventSource.Builder startingPosition(StartingPosition startingPosition) Where to begin consuming the stream.- Parameters:
startingPosition
- Where to begin consuming the stream. This parameter is required.- Returns:
this
-
batchSize
The largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function.Your function receives an event with all the retrieved records. Valid Range: * Minimum value of 1 * Maximum value of: * 1000 for
DynamoEventSource
* 10000 forKinesisEventSource
,ManagedKafkaEventSource
andSelfManagedKafkaEventSource
Default: 100
- Parameters:
batchSize
- The largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function. This parameter is required.- Returns:
this
-
enabled
If the stream event source mapping should be enabled.Default: true
- Parameters:
enabled
- If the stream event source mapping should be enabled. This parameter is required.- Returns:
this
-
maxBatchingWindow
The maximum amount of time to gather records before invoking the function.Maximum of Duration.minutes(5)
Default: Duration.seconds(0)
- Parameters:
maxBatchingWindow
- The maximum amount of time to gather records before invoking the function. This parameter is required.- Returns:
this
-
bisectBatchOnError
If the function returns an error, split the batch in two and retry.Default: false
- Parameters:
bisectBatchOnError
- If the function returns an error, split the batch in two and retry. This parameter is required.- Returns:
this
-
maxRecordAge
The maximum age of a record that Lambda sends to a function for processing.Valid Range:
- Minimum value of 60 seconds
- Maximum value of 7 days
Default: - the retention period configured on the stream
- Parameters:
maxRecordAge
- The maximum age of a record that Lambda sends to a function for processing. This parameter is required.- Returns:
this
-
onFailure
An Amazon SQS queue or Amazon SNS topic destination for discarded records.Default: - discarded records are ignored
- Parameters:
onFailure
- An Amazon SQS queue or Amazon SNS topic destination for discarded records. This parameter is required.- Returns:
this
-
parallelizationFactor
@Stability(Stable) public KinesisEventSource.Builder parallelizationFactor(Number parallelizationFactor) The number of batches to process from each shard concurrently.Valid Range:
- Minimum value of 1
- Maximum value of 10
Default: 1
- Parameters:
parallelizationFactor
- The number of batches to process from each shard concurrently. This parameter is required.- Returns:
this
-
reportBatchItemFailures
@Stability(Stable) public KinesisEventSource.Builder reportBatchItemFailures(Boolean reportBatchItemFailures) Allow functions to return partially successful responses for a batch of records.Default: false
- Parameters:
reportBatchItemFailures
- Allow functions to return partially successful responses for a batch of records. This parameter is required.- Returns:
this
- See Also:
-
retryAttempts
Maximum number of retry attempts Valid Range: * Minimum value of 0 * Maximum value of 10000.Default: - retry until the record expires
- Parameters:
retryAttempts
- Maximum number of retry attempts Valid Range: * Minimum value of 0 * Maximum value of 10000. This parameter is required.- Returns:
this
-
tumblingWindow
The size of the tumbling windows to group records sent to DynamoDB or Kinesis Valid Range: 0 - 15 minutes.Default: - None
- Parameters:
tumblingWindow
- The size of the tumbling windows to group records sent to DynamoDB or Kinesis Valid Range: 0 - 15 minutes. This parameter is required.- Returns:
this
-
build
- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<KinesisEventSource>
- Returns:
- a newly built instance of
KinesisEventSource
.
-