Class KinesisEventSourceProps.Builder
java.lang.Object
software.amazon.awscdk.services.lambda.eventsources.KinesisEventSourceProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<KinesisEventSourceProps>
- Enclosing interface:
- KinesisEventSourceProps
@Stability(Stable)
public static final class KinesisEventSourceProps.Builder
extends Object
implements software.amazon.jsii.Builder<KinesisEventSourceProps>
A builder for
KinesisEventSourceProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSets the value ofBaseStreamEventSourceProps.getBatchSize()
bisectBatchOnError
(Boolean bisectBatchOnError) Sets the value ofStreamEventSourceProps.getBisectBatchOnError()
build()
Builds the configured instance.Sets the value ofBaseStreamEventSourceProps.getEnabled()
maxBatchingWindow
(Duration maxBatchingWindow) Sets the value ofBaseStreamEventSourceProps.getMaxBatchingWindow()
maxRecordAge
(Duration maxRecordAge) Sets the value ofStreamEventSourceProps.getMaxRecordAge()
onFailure
(IEventSourceDlq onFailure) Sets the value ofStreamEventSourceProps.getOnFailure()
parallelizationFactor
(Number parallelizationFactor) Sets the value ofStreamEventSourceProps.getParallelizationFactor()
reportBatchItemFailures
(Boolean reportBatchItemFailures) Sets the value ofStreamEventSourceProps.getReportBatchItemFailures()
retryAttempts
(Number retryAttempts) Sets the value ofStreamEventSourceProps.getRetryAttempts()
startingPosition
(StartingPosition startingPosition) Sets the value ofBaseStreamEventSourceProps.getStartingPosition()
tumblingWindow
(Duration tumblingWindow) Sets the value ofStreamEventSourceProps.getTumblingWindow()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
bisectBatchOnError
@Stability(Stable) public KinesisEventSourceProps.Builder bisectBatchOnError(Boolean bisectBatchOnError) Sets the value ofStreamEventSourceProps.getBisectBatchOnError()
- Parameters:
bisectBatchOnError
- If the function returns an error, split the batch in two and retry.- Returns:
this
-
maxRecordAge
Sets the value ofStreamEventSourceProps.getMaxRecordAge()
- Parameters:
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
- Returns:
this
-
onFailure
Sets the value ofStreamEventSourceProps.getOnFailure()
- Parameters:
onFailure
- An Amazon SQS queue or Amazon SNS topic destination for discarded records.- Returns:
this
-
parallelizationFactor
@Stability(Stable) public KinesisEventSourceProps.Builder parallelizationFactor(Number parallelizationFactor) Sets the value ofStreamEventSourceProps.getParallelizationFactor()
- Parameters:
parallelizationFactor
- The number of batches to process from each shard concurrently. Valid Range:- Minimum value of 1
- Maximum value of 10
- Returns:
this
-
reportBatchItemFailures
@Stability(Stable) public KinesisEventSourceProps.Builder reportBatchItemFailures(Boolean reportBatchItemFailures) Sets the value ofStreamEventSourceProps.getReportBatchItemFailures()
- Parameters:
reportBatchItemFailures
- Allow functions to return partially successful responses for a batch of records.- Returns:
this
-
retryAttempts
Sets the value ofStreamEventSourceProps.getRetryAttempts()
- Parameters:
retryAttempts
- Maximum number of retry attempts Valid Range: * Minimum value of 0 * Maximum value of 10000.- Returns:
this
-
tumblingWindow
Sets the value ofStreamEventSourceProps.getTumblingWindow()
- Parameters:
tumblingWindow
- The size of the tumbling windows to group records sent to DynamoDB or Kinesis Valid Range: 0 - 15 minutes.- Returns:
this
-
startingPosition
@Stability(Stable) public KinesisEventSourceProps.Builder startingPosition(StartingPosition startingPosition) Sets the value ofBaseStreamEventSourceProps.getStartingPosition()
- Parameters:
startingPosition
- Where to begin consuming the stream. This parameter is required.- Returns:
this
-
batchSize
Sets the value ofBaseStreamEventSourceProps.getBatchSize()
- Parameters:
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 forDynamoEventSource
* 10000 forKinesisEventSource
,ManagedKafkaEventSource
andSelfManagedKafkaEventSource
- Returns:
this
-
enabled
Sets the value ofBaseStreamEventSourceProps.getEnabled()
- Parameters:
enabled
- If the stream event source mapping should be enabled.- Returns:
this
-
maxBatchingWindow
@Stability(Stable) public KinesisEventSourceProps.Builder maxBatchingWindow(Duration maxBatchingWindow) Sets the value ofBaseStreamEventSourceProps.getMaxBatchingWindow()
- Parameters:
maxBatchingWindow
- The maximum amount of time to gather records before invoking the function. Maximum of Duration.minutes(5)- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<KinesisEventSourceProps>
- Returns:
- a new instance of
KinesisEventSourceProps
- Throws:
NullPointerException
- if any required attribute was not provided
-