Class KafkaEventSourceProps.Builder
java.lang.Object
software.amazon.awscdk.services.lambda.eventsources.KafkaEventSourceProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<KafkaEventSourceProps>
- Enclosing interface:
KafkaEventSourceProps
@Stability(Stable)
public static final class KafkaEventSourceProps.Builder
extends Object
implements software.amazon.jsii.Builder<KafkaEventSourceProps>
A builder for
KafkaEventSourceProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSets the value ofBaseStreamEventSourceProps.getBatchSize()
build()
Builds the configured instance.consumerGroupId
(String consumerGroupId) Sets the value ofKafkaEventSourceProps.getConsumerGroupId()
Sets the value ofBaseStreamEventSourceProps.getEnabled()
filterEncryption
(IKey filterEncryption) Sets the value ofKafkaEventSourceProps.getFilterEncryption()
Sets the value ofKafkaEventSourceProps.getFilters()
maxBatchingWindow
(Duration maxBatchingWindow) Sets the value ofBaseStreamEventSourceProps.getMaxBatchingWindow()
onFailure
(IEventSourceDlq onFailure) Sets the value ofKafkaEventSourceProps.getOnFailure()
provisionedPollerConfig
(ProvisionedPollerConfig provisionedPollerConfig) Sets the value ofBaseStreamEventSourceProps.getProvisionedPollerConfig()
Sets the value ofKafkaEventSourceProps.getSecret()
startingPosition
(StartingPosition startingPosition) Sets the value ofBaseStreamEventSourceProps.getStartingPosition()
Sets the value ofKafkaEventSourceProps.getTopic()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
topic
Sets the value ofKafkaEventSourceProps.getTopic()
- Parameters:
topic
- The Kafka topic to subscribe to. This parameter is required.- Returns:
this
-
consumerGroupId
Sets the value ofKafkaEventSourceProps.getConsumerGroupId()
- Parameters:
consumerGroupId
- 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-/:_+=.@-]'.- Returns:
this
-
filterEncryption
Sets the value ofKafkaEventSourceProps.getFilterEncryption()
- Parameters:
filterEncryption
- Add Customer managed KMS key to encrypt Filter Criteria.- Returns:
this
-
filters
@Stability(Stable) public KafkaEventSourceProps.Builder filters(List<? extends Map<String, ? extends Object>> filters) Sets the value ofKafkaEventSourceProps.getFilters()
- Parameters:
filters
- Add filter criteria to Event Source.- Returns:
this
-
onFailure
Sets the value ofKafkaEventSourceProps.getOnFailure()
- Parameters:
onFailure
- Add an on Failure Destination for this Kafka event. SNS/SQS/S3 are supported- Returns:
this
-
secret
Sets the value ofKafkaEventSourceProps.getSecret()
- Parameters:
secret
- The secret with the Kafka credentials, see https://docs.aws.amazon.com/msk/latest/developerguide/msk-password.html for details This field is required if your Kafka brokers are accessed over the Internet.- Returns:
this
-
startingPosition
@Stability(Stable) public KafkaEventSourceProps.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 KafkaEventSourceProps.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 KafkaEventSourceProps.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<KafkaEventSourceProps>
- Returns:
- a new instance of
KafkaEventSourceProps
- Throws:
NullPointerException
- if any required attribute was not provided
-