@Generated(value="jsii-pacmak/1.58.0 (build f8ba112)", date="2022-05-11T19:24:19.791Z") @Stability(value=Stable) public interface ManagedKafkaEventSourceProps extends software.amazon.jsii.JsiiSerializable, KafkaEventSourceProps
Example:
import software.amazon.awscdk.services.secretsmanager.Secret;
import software.amazon.awscdk.services.lambda.eventsources.ManagedKafkaEventSource;
Function myFunction;
// Your MSK cluster arn
String clusterArn = "arn:aws:kafka:us-east-1:0123456789019:cluster/SalesCluster/abcd1234-abcd-cafe-abab-9876543210ab-4";
// The Kafka topic you want to subscribe to
String topic = "some-cool-topic";
// The secret that allows access to your MSK cluster
// You still have to make sure that it is associated with your cluster as described in the documentation
Secret secret = Secret.Builder.create(this, "Secret").secretName("AmazonMSK_KafkaSecret").build();
myFunction.addEventSource(ManagedKafkaEventSource.Builder.create()
.clusterArn(clusterArn)
.topic(topic)
.secret(secret)
.batchSize(100) // default
.startingPosition(StartingPosition.TRIM_HORIZON)
.build());
| Modifier and Type | Interface and Description |
|---|---|
static class |
ManagedKafkaEventSourceProps.Builder
A builder for
ManagedKafkaEventSourceProps |
static class |
ManagedKafkaEventSourceProps.Jsii$Proxy
An implementation for
ManagedKafkaEventSourceProps |
| Modifier and Type | Method and Description |
|---|---|
static ManagedKafkaEventSourceProps.Builder |
builder() |
String |
getClusterArn()
An MSK cluster construct.
|
getSecret, getTopicgetBatchSize, getEnabled, getMaxBatchingWindow, getStartingPosition@Stability(value=Stable) @NotNull String getClusterArn()
@Stability(value=Stable) static ManagedKafkaEventSourceProps.Builder builder()
builder in interface BaseStreamEventSourcePropsbuilder in interface KafkaEventSourcePropsManagedKafkaEventSourceProps.Builder of ManagedKafkaEventSourcePropsCopyright © 2022. All rights reserved.