Class EventSourceMappingOptions.Builder
java.lang.Object
software.amazon.awscdk.services.lambda.EventSourceMappingOptions.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<EventSourceMappingOptions>
- Enclosing interface:
EventSourceMappingOptions
@Stability(Stable)
public static final class EventSourceMappingOptions.Builder
extends Object
implements software.amazon.jsii.Builder<EventSourceMappingOptions>
A builder for
EventSourceMappingOptions
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSets the value ofEventSourceMappingOptions.getBatchSize()
bisectBatchOnError
(Boolean bisectBatchOnError) Sets the value ofEventSourceMappingOptions.getBisectBatchOnError()
build()
Builds the configured instance.Sets the value ofEventSourceMappingOptions.getEnabled()
eventSourceArn
(String eventSourceArn) Sets the value ofEventSourceMappingOptions.getEventSourceArn()
filterEncryption
(IKey filterEncryption) Sets the value ofEventSourceMappingOptions.getFilterEncryption()
Sets the value ofEventSourceMappingOptions.getFilters()
kafkaBootstrapServers
(List<String> kafkaBootstrapServers) Sets the value ofEventSourceMappingOptions.getKafkaBootstrapServers()
kafkaConsumerGroupId
(String kafkaConsumerGroupId) Sets the value ofEventSourceMappingOptions.getKafkaConsumerGroupId()
kafkaTopic
(String kafkaTopic) Sets the value ofEventSourceMappingOptions.getKafkaTopic()
maxBatchingWindow
(Duration maxBatchingWindow) Sets the value ofEventSourceMappingOptions.getMaxBatchingWindow()
maxConcurrency
(Number maxConcurrency) Sets the value ofEventSourceMappingOptions.getMaxConcurrency()
maxRecordAge
(Duration maxRecordAge) Sets the value ofEventSourceMappingOptions.getMaxRecordAge()
metricsConfig
(MetricsConfig metricsConfig) Sets the value ofEventSourceMappingOptions.getMetricsConfig()
onFailure
(IEventSourceDlq onFailure) Sets the value ofEventSourceMappingOptions.getOnFailure()
parallelizationFactor
(Number parallelizationFactor) Sets the value ofEventSourceMappingOptions.getParallelizationFactor()
provisionedPollerConfig
(ProvisionedPollerConfig provisionedPollerConfig) Sets the value ofEventSourceMappingOptions.getProvisionedPollerConfig()
reportBatchItemFailures
(Boolean reportBatchItemFailures) Sets the value ofEventSourceMappingOptions.getReportBatchItemFailures()
retryAttempts
(Number retryAttempts) Sets the value ofEventSourceMappingOptions.getRetryAttempts()
sourceAccessConfigurations
(List<? extends SourceAccessConfiguration> sourceAccessConfigurations) Sets the value ofEventSourceMappingOptions.getSourceAccessConfigurations()
startingPosition
(StartingPosition startingPosition) Sets the value ofEventSourceMappingOptions.getStartingPosition()
startingPositionTimestamp
(Number startingPositionTimestamp) Sets the value ofEventSourceMappingOptions.getStartingPositionTimestamp()
supportS3OnFailureDestination
(Boolean supportS3OnFailureDestination) Sets the value ofEventSourceMappingOptions.getSupportS3OnFailureDestination()
tumblingWindow
(Duration tumblingWindow) Sets the value ofEventSourceMappingOptions.getTumblingWindow()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
batchSize
Sets the value ofEventSourceMappingOptions.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 10000.
- Returns:
this
-
bisectBatchOnError
@Stability(Stable) public EventSourceMappingOptions.Builder bisectBatchOnError(Boolean bisectBatchOnError) Sets the value ofEventSourceMappingOptions.getBisectBatchOnError()
- Parameters:
bisectBatchOnError
- If the function returns an error, split the batch in two and retry.- Returns:
this
-
enabled
Sets the value ofEventSourceMappingOptions.getEnabled()
- Parameters:
enabled
- Set to false to disable the event source upon creation.- Returns:
this
-
eventSourceArn
Sets the value ofEventSourceMappingOptions.getEventSourceArn()
- Parameters:
eventSourceArn
- The Amazon Resource Name (ARN) of the event source. Any record added to this stream can invoke the Lambda function.- Returns:
this
-
filterEncryption
Sets the value ofEventSourceMappingOptions.getFilterEncryption()
- Parameters:
filterEncryption
- Add Customer managed KMS key to encrypt Filter Criteria.- Returns:
this
-
filters
@Stability(Stable) public EventSourceMappingOptions.Builder filters(List<? extends Map<String, ? extends Object>> filters) Sets the value ofEventSourceMappingOptions.getFilters()
- Parameters:
filters
- Add filter criteria to Event Source.- Returns:
this
-
kafkaBootstrapServers
@Stability(Stable) public EventSourceMappingOptions.Builder kafkaBootstrapServers(List<String> kafkaBootstrapServers) Sets the value ofEventSourceMappingOptions.getKafkaBootstrapServers()
- Parameters:
kafkaBootstrapServers
- A list of host and port pairs that are the addresses of the Kafka brokers in a self managed "bootstrap" Kafka cluster that a Kafka client connects to initially to bootstrap itself. They are in the formatabc.example.com:9096
.- Returns:
this
-
kafkaConsumerGroupId
@Stability(Stable) public EventSourceMappingOptions.Builder kafkaConsumerGroupId(String kafkaConsumerGroupId) Sets the value ofEventSourceMappingOptions.getKafkaConsumerGroupId()
- Parameters:
kafkaConsumerGroupId
- The identifier for the Kafka consumer group to join. The consumer group ID must be unique among all your Kafka event sources. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value. The value must have a lenght between 1 and 200 and full the pattern '[a-zA-Z0-9-/:_+=.@-]'. For more information, see Customizable consumer group ID.- Returns:
this
-
kafkaTopic
Sets the value ofEventSourceMappingOptions.getKafkaTopic()
- Parameters:
kafkaTopic
- The name of the Kafka topic.- Returns:
this
-
maxBatchingWindow
@Stability(Stable) public EventSourceMappingOptions.Builder maxBatchingWindow(Duration maxBatchingWindow) Sets the value ofEventSourceMappingOptions.getMaxBatchingWindow()
- Parameters:
maxBatchingWindow
- The maximum amount of time to gather records before invoking the function. Maximum of Duration.minutes(5)- Returns:
this
-
maxConcurrency
Sets the value ofEventSourceMappingOptions.getMaxConcurrency()
- Parameters:
maxConcurrency
- The maximum concurrency setting limits the number of concurrent instances of the function that an Amazon SQS event source can invoke.- Returns:
this
-
maxRecordAge
Sets the value ofEventSourceMappingOptions.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
-
metricsConfig
@Stability(Stable) public EventSourceMappingOptions.Builder metricsConfig(MetricsConfig metricsConfig) Sets the value ofEventSourceMappingOptions.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 ofEventSourceMappingOptions.getOnFailure()
- Parameters:
onFailure
- An Amazon SQS queue or Amazon SNS topic destination for discarded records.- Returns:
this
-
parallelizationFactor
@Stability(Stable) public EventSourceMappingOptions.Builder parallelizationFactor(Number parallelizationFactor) Sets the value ofEventSourceMappingOptions.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
-
provisionedPollerConfig
@Stability(Stable) public EventSourceMappingOptions.Builder provisionedPollerConfig(ProvisionedPollerConfig provisionedPollerConfig) Sets the value ofEventSourceMappingOptions.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
-
reportBatchItemFailures
@Stability(Stable) public EventSourceMappingOptions.Builder reportBatchItemFailures(Boolean reportBatchItemFailures) Sets the value ofEventSourceMappingOptions.getReportBatchItemFailures()
- Parameters:
reportBatchItemFailures
- Allow functions to return partially successful responses for a batch of records.- Returns:
this
-
retryAttempts
Sets the value ofEventSourceMappingOptions.getRetryAttempts()
- Parameters:
retryAttempts
- The maximum number of times to retry when the function returns an error. Set toundefined
if you want lambda to keep retrying infinitely or until the record expires.Valid Range:
- Minimum value of 0
- Maximum value of 10000
- Returns:
this
-
sourceAccessConfigurations
@Stability(Stable) public EventSourceMappingOptions.Builder sourceAccessConfigurations(List<? extends SourceAccessConfiguration> sourceAccessConfigurations) Sets the value ofEventSourceMappingOptions.getSourceAccessConfigurations()
- Parameters:
sourceAccessConfigurations
- Specific settings like the authentication protocol or the VPC components to secure access to your event source.- Returns:
this
-
startingPosition
@Stability(Stable) public EventSourceMappingOptions.Builder startingPosition(StartingPosition startingPosition) Sets the value ofEventSourceMappingOptions.getStartingPosition()
- Parameters:
startingPosition
- The position in the DynamoDB, Kinesis or MSK stream where AWS Lambda should start reading.- Returns:
this
-
startingPositionTimestamp
@Stability(Stable) public EventSourceMappingOptions.Builder startingPositionTimestamp(Number startingPositionTimestamp) Sets the value ofEventSourceMappingOptions.getStartingPositionTimestamp()
- Parameters:
startingPositionTimestamp
- The time from which to start reading, in Unix time seconds.- Returns:
this
-
supportS3OnFailureDestination
@Stability(Stable) public EventSourceMappingOptions.Builder supportS3OnFailureDestination(Boolean supportS3OnFailureDestination) Sets the value ofEventSourceMappingOptions.getSupportS3OnFailureDestination()
- Parameters:
supportS3OnFailureDestination
- Check if support S3 onfailure destination(ODF). Currently only MSK and self managed kafka event support S3 ODF- Returns:
this
-
tumblingWindow
Sets the value ofEventSourceMappingOptions.getTumblingWindow()
- Parameters:
tumblingWindow
- The size of the tumbling windows to group records sent to DynamoDB or Kinesis.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<EventSourceMappingOptions>
- Returns:
- a new instance of
EventSourceMappingOptions
- Throws:
NullPointerException
- if any required attribute was not provided
-