Skip to content

Commit

Permalink
Add docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
bracki committed Jan 15, 2021
1 parent 801cb76 commit c6e5881
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
14 changes: 14 additions & 0 deletions packages/@aws-cdk/aws-lambda-event-sources/lib/kafka.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ export interface KafkaEventSourceProps extends StreamEventSourceProps {
* Use a MSK cluster as a streaming source for AWS Lambda
*/
export class ManagedKafkaEventSource extends StreamEventSource {
/**
* Create an event source for MSK
* @param clusterArn - the ARN of the MSK cluster
* @param topic - the Kafka topic to subscribe to
* @param secret - the secret with the Kafka credentials, see https://docs.aws.amazon.com/msk/latest/developerguide/msk-password.html for details
* @param props
*/
constructor(
readonly clusterArn: string,
readonly topic: string,
Expand Down Expand Up @@ -46,6 +53,13 @@ export class ManagedKafkaEventSource extends StreamEventSource {
* Use a self hosted Kafka installation as a streaming source for AWS Lambda.
*/
export class SelfManagedKafkaEventSource extends StreamEventSource {
/**
* Create an event source for a self managed Kafka cluster
* @param bootstrapServers - list of Kafka brokers
* @param topic - the Kafka topic to subscribe to
* @param secret - the secret with the Kafka credentials, see https://docs.aws.amazon.com/lambda/latest/dg/smaa-permissions.html#smaa-permissions-add-secret
* @param props
*/
constructor(
readonly bootstrapServers: string[],
readonly topic: string,
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-lambda-event-sources/lib/stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Duration } from '@aws-cdk/core';

/**
* The set of properties for event sources that follow the streaming model,
* such as, Dynamo and Kinesis.
* such as, Dynamo, Kinesis and Kafka.
*/
export interface StreamEventSourceProps {
/**
Expand Down
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-lambda-event-sources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@
"docs-public-apis:@aws-cdk/aws-lambda-event-sources.KinesisEventSourceProps",
"docs-public-apis:@aws-cdk/aws-lambda-event-sources.S3EventSourceProps",
"props-default-doc:@aws-cdk/aws-lambda-event-sources.S3EventSourceProps.filters",
"docs-public-apis:@aws-cdk/aws-lambda-event-sources.SqsEventSourceProps"
"docs-public-apis:@aws-cdk/aws-lambda-event-sources.SqsEventSourceProps",
"docs-public-apis:@aws-cdk/aws-lambda-event-sources.KafkaEventSourceProps"
]
},
"awscdkio": {
Expand Down

0 comments on commit c6e5881

Please sign in to comment.