Interface SelfManagedKafkaEventSourceProps

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

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:46.839Z") @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";
 myFunction.addEventSource(SelfManagedKafkaEventSource.Builder.create()
         .bootstrapServers(bootstrapServers)
         .topic(topic)
         .secret(secret)
         .batchSize(100) // default
         .startingPosition(StartingPosition.TRIM_HORIZON)
         .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

    • 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