Class KinesisEventSource.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<KinesisEventSource>
- Enclosing class:
KinesisEventSource
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.filterEncryption
(IKey filterEncryption) Add Customer managed KMS key to encrypt Filter Criteria.Add filter criteria option.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.metricsConfig
(MetricsConfig metricsConfig) Configuration for enhanced monitoring metrics collection When specified, enables collection of additional metrics for the stream event source.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.provisionedPollerConfig
(ProvisionedPollerConfig provisionedPollerConfig) Configuration for provisioned pollers that read from the event source.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.startingPositionTimestamp
(Number startingPositionTimestamp) The time from which to start reading, in Unix time seconds.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 for
KinesisEventSource
,ManagedKafkaEventSource
andSelfManagedKafkaEventSource
- 1000 for
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) for Kinesis, DynamoDB, and SQS event sources, Duration.millis(500) for MSK, self-managed Kafka, and Amazon MQ.
- Parameters:
maxBatchingWindow
- The maximum amount of time to gather records before invoking the function. This parameter is required.- Returns:
this
- See Also:
-
provisionedPollerConfig
@Stability(Stable) public KinesisEventSource.Builder provisionedPollerConfig(ProvisionedPollerConfig 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.
Default: - no provisioned pollers
- Parameters:
provisionedPollerConfig
- Configuration for provisioned pollers that read from the event source. 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
-
filterEncryption
Add Customer managed KMS key to encrypt Filter Criteria.Default: - none
- Parameters:
filterEncryption
- Add Customer managed KMS key to encrypt Filter Criteria. This parameter is required.- Returns:
this
- See Also:
-
filters
@Stability(Stable) public KinesisEventSource.Builder filters(List<? extends Map<String, ? extends Object>> filters) Add filter criteria option.Default: - None
- Parameters:
filters
- Add filter criteria option. 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
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.
Default: -1
- Parameters:
maxRecordAge
- The maximum age of a record that Lambda sends to a function for processing. This parameter is required.- Returns:
this
-
metricsConfig
Configuration for enhanced monitoring metrics collection When specified, enables collection of additional metrics for the stream event source.Default: - Enhanced monitoring is disabled
- Parameters:
metricsConfig
- Configuration for enhanced monitoring metrics collection When specified, enables collection of additional metrics for the stream event source. 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.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.
Default: -1
- 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
-
startingPositionTimestamp
@Stability(Stable) public KinesisEventSource.Builder startingPositionTimestamp(Number startingPositionTimestamp) The time from which to start reading, in Unix time seconds.Default: - no timestamp
- Parameters:
startingPositionTimestamp
- The time from which to start reading, in Unix time seconds. This parameter is required.- Returns:
this
-
build
- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<KinesisEventSource>
- Returns:
- a newly built instance of
KinesisEventSource
.
-