Interface SelfManagedKafkaEventSourceProps
- All Superinterfaces:
BaseStreamEventSourceProps,software.amazon.jsii.JsiiSerializable,KafkaEventSourceProps
- All Known Implementing Classes:
SelfManagedKafkaEventSourceProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-24T13:34:41.375Z")
@Stability(Stable)
public interface SelfManagedKafkaEventSourceProps
extends software.amazon.jsii.JsiiSerializable, KafkaEventSourceProps
Properties for a self managed Kafka cluster event source.
If your Kafka cluster is only reachable via VPC make sure to configure it.
Example:
import software.amazon.awscdk.services.secretsmanager.Secret;
import software.amazon.awscdk.services.lambda.eventsources.SelfManagedKafkaEventSource;
// The secret that allows access to your self hosted Kafka cluster
Secret secret;
Function myFunction;
// The list of Kafka brokers
String[] bootstrapServers = List.of("kafka-broker:9092");
// The Kafka topic you want to subscribe to
String topic = "some-cool-topic";
// (Optional) The consumer group id to use when connecting to the Kafka broker. If omitted the UUID of the event source mapping will be used.
String consumerGroupId = "my-consumer-group-id";
myFunction.addEventSource(SelfManagedKafkaEventSource.Builder.create()
.bootstrapServers(bootstrapServers)
.topic(topic)
.consumerGroupId(consumerGroupId)
.secret(secret)
.batchSize(100) // default
.startingPosition(StartingPosition.TRIM_HORIZON)
.build());
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forSelfManagedKafkaEventSourcePropsstatic final classAn implementation forSelfManagedKafkaEventSourceProps -
Method Summary
Modifier and TypeMethodDescriptionbuilder()default AuthenticationMethodThe authentication method for your Kafka cluster.The list of host and port pairs that are the addresses of the Kafka brokers in a "bootstrap" Kafka cluster that a Kafka client connects to initially to bootstrap itself.default ISecretThe secret with the root CA certificate used by your Kafka brokers for TLS encryption This field is required if your Kafka brokers use certificates signed by a private CA.default ISecurityGroupIf your Kafka brokers are only reachable via VPC, provide the security group here.default IVpcgetVpc()If your Kafka brokers are only reachable via VPC provide the VPC here.default SubnetSelectionIf your Kafka brokers are only reachable via VPC, provide the subnets selection here.Methods inherited from interface software.amazon.awscdk.services.lambda.eventsources.BaseStreamEventSourceProps
getBatchSize, getEnabled, getMaxBatchingWindow, getProvisionedPollerConfig, getStartingPositionMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJsonMethods inherited from interface software.amazon.awscdk.services.lambda.eventsources.KafkaEventSourceProps
getConsumerGroupId, getFilterEncryption, getFilters, getOnFailure, getSchemaRegistryConfig, getSecret, getStartingPositionTimestamp, getTopic
-
Method Details
-
getBootstrapServers
The list of host and port pairs that are the addresses of the Kafka brokers in a "bootstrap" Kafka cluster that a Kafka client connects to initially to bootstrap itself.They are in the format
abc.xyz.com:xxxx. -
getAuthenticationMethod
The authentication method for your Kafka cluster.Default: AuthenticationMethod.SASL_SCRAM_512_AUTH
-
getRootCACertificate
The secret with the root CA certificate used by your Kafka brokers for TLS encryption This field is required if your Kafka brokers use certificates signed by a private CA.Default: - none
-
getSecurityGroup
If your Kafka brokers are only reachable via VPC, provide the security group here.Default: - none, required if setting vpc
-
getVpc
If your Kafka brokers are only reachable via VPC provide the VPC here.Default: none
-
getVpcSubnets
If your Kafka brokers are only reachable via VPC, provide the subnets selection here.Default: - none, required if setting vpc
-
builder
-