Class KafkaEventSourceProps
Properties for a Kafka event source.
Inheritance
Namespace: Amazon.CDK.AWS.Lambda.EventSources
Assembly: Amazon.CDK.AWS.Lambda.EventSources.dll
Syntax (csharp)
public class KafkaEventSourceProps : Object, IKafkaEventSourceProps, IBaseStreamEventSourceProps
Syntax (vb)
Public Class KafkaEventSourceProps
Inherits Object
Implements IKafkaEventSourceProps, IBaseStreamEventSourceProps
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Lambda;
using Amazon.CDK.AWS.Lambda.EventSources;
using Amazon.CDK.AWS.SecretsManager;
using Amazon.CDK;
Secret secret;
var kafkaEventSourceProps = new KafkaEventSourceProps {
StartingPosition = StartingPosition.TRIM_HORIZON,
Topic = "topic",
// the properties below are optional
BatchSize = 123,
Enabled = false,
MaxBatchingWindow = Duration.Minutes(30),
Secret = secret
};
Synopsis
Constructors
KafkaEventSourceProps() |
Properties
BatchSize | The largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function. |
Enabled | If the stream event source mapping should be enabled. |
MaxBatchingWindow | The maximum amount of time to gather records before invoking the function. |
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. |
StartingPosition | Where to begin consuming the stream. |
Topic | The Kafka topic to subscribe to. |
Constructors
KafkaEventSourceProps()
public KafkaEventSourceProps()
Properties
BatchSize
The largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function.
public Nullable<double> BatchSize { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
Your function receives an event with all the retrieved records.
Valid Range:
Default: 100
Enabled
If the stream event source mapping should be enabled.
public Nullable<bool> Enabled { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: true
MaxBatchingWindow
The maximum amount of time to gather records before invoking the function.
public Duration MaxBatchingWindow { get; set; }
Property Value
Remarks
Maximum of Duration.minutes(5)
Default: Duration.seconds(0)
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.
public ISecret Secret { get; set; }
Property Value
Remarks
Default: none
StartingPosition
Where to begin consuming the stream.
public StartingPosition StartingPosition { get; set; }
Property Value
Topic
The Kafka topic to subscribe to.
public string Topic { get; set; }
Property Value
System.String