Interface SelfManagedKafkaEventSourceProps

All Superinterfaces:
BaseStreamEventSourceProps, software.amazon.jsii.JsiiSerializable, KafkaEventSourceProps
All Known Implementing Classes:
SelfManagedKafkaEventSourceProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.120.0 (build 192dc88)", date="2025-12-12T17:54:16.466Z") @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.lambda.eventsources.SelfManagedKafkaEventSource;
 import software.amazon.awscdk.services.lambda.eventsources.AuthenticationMethod;
 import software.amazon.awscdk.services.lambda.StartingPosition;
 import software.amazon.awscdk.services.lambda.Function;
 import software.amazon.awscdk.services.secretsmanager.ISecret;
 // With provisioned pollers and poller group for cost optimization
 Function myFunction;
 ISecret kafkaCredentials;
 myFunction.addEventSource(SelfManagedKafkaEventSource.Builder.create()
         .bootstrapServers(List.of("kafka-broker1.example.com:9092", "kafka-broker2.example.com:9092"))
         .topic("events-topic")
         .secret(kafkaCredentials)
         .startingPosition(StartingPosition.LATEST)
         .authenticationMethod(AuthenticationMethod.SASL_SCRAM_512_AUTH)
         .provisionedPollerConfig(ProvisionedPollerConfig.builder()
                 .minimumPollers(1)
                 .maximumPollers(8)
                 .pollerGroupName("self-managed-kafka-group")
                 .build())
         .build());
 
  • Method Details

    • getBootstrapServers

      @Stability(Stable) @NotNull List<String> 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

      @Stability(Stable) @Nullable default AuthenticationMethod getAuthenticationMethod()
      The authentication method for your Kafka cluster.

      Default: AuthenticationMethod.SASL_SCRAM_512_AUTH

    • getRootCACertificate

      @Stability(Stable) @Nullable default ISecret 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

      @Stability(Stable) @Nullable default ISecurityGroup getSecurityGroup()
      If your Kafka brokers are only reachable via VPC, provide the security group here.

      Default: - none, required if setting vpc

    • getVpc

      @Stability(Stable) @Nullable default IVpc getVpc()
      If your Kafka brokers are only reachable via VPC provide the VPC here.

      Default: none

    • getVpcSubnets

      @Stability(Stable) @Nullable default SubnetSelection getVpcSubnets()
      If your Kafka brokers are only reachable via VPC, provide the subnets selection here.

      Default: - none, required if setting vpc

    • builder

      @Stability(Stable) static SelfManagedKafkaEventSourceProps.Builder builder()
      Returns:
      a SelfManagedKafkaEventSourceProps.Builder of SelfManagedKafkaEventSourceProps