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()
filterEncryption
(IKey filterEncryption) Sets the value ofStreamEventSourceProps.getFilterEncryption()
Sets the value ofStreamEventSourceProps.getFilters()
maxBatchingWindow
(Duration maxBatchingWindow) Sets the value ofBaseStreamEventSourceProps.getMaxBatchingWindow()
maxRecordAge
(Duration maxRecordAge) Sets the value ofStreamEventSourceProps.getMaxRecordAge()
metricsConfig
(MetricsConfig metricsConfig) Sets the value ofStreamEventSourceProps.getMetricsConfig()
onFailure
(IEventSourceDlq onFailure) Sets the value ofStreamEventSourceProps.getOnFailure()
parallelizationFactor
(Number parallelizationFactor) Sets the value ofStreamEventSourceProps.getParallelizationFactor()
provisionedPollerConfig
(ProvisionedPollerConfig provisionedPollerConfig) Sets the value ofBaseStreamEventSourceProps.getProvisionedPollerConfig()
reportBatchItemFailures
(Boolean reportBatchItemFailures) Sets the value ofStreamEventSourceProps.getReportBatchItemFailures()
retryAttempts
(Number retryAttempts) Sets the value ofStreamEventSourceProps.getRetryAttempts()
startingPosition
(StartingPosition startingPosition) Sets the value ofBaseStreamEventSourceProps.getStartingPosition()
startingPositionTimestamp
(Number startingPositionTimestamp) Sets the value ofKinesisEventSourceProps.getStartingPositionTimestamp()
tumblingWindow
(Duration tumblingWindow) Sets the value ofStreamEventSourceProps.getTumblingWindow()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
startingPositionTimestamp
@Stability(Stable) public KinesisEventSourceProps.Builder startingPositionTimestamp(Number startingPositionTimestamp) Sets the value ofKinesisEventSourceProps.getStartingPositionTimestamp()
- Parameters:
startingPositionTimestamp
- The time from which to start reading, in Unix time seconds.- Returns:
this
-
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
-
filterEncryption
Sets the value ofStreamEventSourceProps.getFilterEncryption()
- Parameters:
filterEncryption
- Add Customer managed KMS key to encrypt Filter Criteria.- Returns:
this
-
filters
@Stability(Stable) public KinesisEventSourceProps.Builder filters(List<? extends Map<String, ? extends Object>> filters) Sets the value ofStreamEventSourceProps.getFilters()
- Parameters:
filters
- Add filter criteria option.- 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
The default value is -1, which sets the maximum age to infinite. When the value is set to infinite, Lambda never discards old records. Record are valid until it expires in the event source.
- Returns:
this
-
metricsConfig
@Stability(Stable) public KinesisEventSourceProps.Builder metricsConfig(MetricsConfig metricsConfig) Sets the value ofStreamEventSourceProps.getMetricsConfig()
- Parameters:
metricsConfig
- Configuration for enhanced monitoring metrics collection When specified, enables collection of additional metrics for the stream event source.- 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. The default value is -1, which sets the maximum number of retries to infinite. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source.- 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 for
DynamoEventSource
- 10000 for
KinesisEventSource
,ManagedKafkaEventSource
andSelfManagedKafkaEventSource
- 1000 for
- 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
-
provisionedPollerConfig
@Stability(Stable) public KinesisEventSourceProps.Builder provisionedPollerConfig(ProvisionedPollerConfig provisionedPollerConfig) Sets the value ofBaseStreamEventSourceProps.getProvisionedPollerConfig()
- Parameters:
provisionedPollerConfig
- Configuration for provisioned pollers that read from the event source. When specified, allows control over the minimum and maximum number of pollers that can be provisioned to process events from the source.- 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
-