import * as lambda from 'aws-cdk-lib/aws-lambda'; import * as lambdaEventSource from 'aws-cdk-lib/aws-lambda-event-sources'; import * as secretsmanager from 'aws-cdk-lib/aws-secretsmanager'; /** * Properties for RioKafkaEventSource */ export interface RioKafkaEventSourceProps extends lambdaEventSource.BaseStreamEventSourceProps { /** * The Kafka topic to subscribe to */ readonly topic: string; /** * The secret with the Kafka credentials, see https://docs.aws.amazon.com/msk/latest/developerguide/msk-authentication.html for details. * * You can use the `create-and-sign-certificate` script from the `kafka-integration` to create a suitable AWS Secrets Manager secret. * Simply add the `--fqdn --lambda` parameters to the `create-and-sign-certificate` script and the script generates a secret named `kafka-integration/msk-certificate/` with all relevant data. * * Please note that we do only support the `--lambda` parameter if the `--fqdn` parameter is present. * We encourage you to use the `--fqdn` parameter for all your Kafka consumers and producers as this eases the recovery process in the case of a disaster. * (Otherwise, i.e., if you do not use the `--fqdn` parameter, your certificates CNAME contains the AWS account ID and you need to change all ACLs in case of a corrupted AWS account.) */ readonly secret: secretsmanager.ISecret; /** * The identifier for the Kafka consumer group to join. * The consumer group ID must be unique among all your Kafka event sources. * After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value. * The value must have a lenght between 1 and 200 and full the pattern '[a-zA-Z0-9-\/*:_+=.\@-]*'. * @see https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-consumer-group-id * * @defaultValue - none */ readonly consumerGroupId?: string; } /** * Use the Rio Kafka as a streaming source for AWS Lambda. * * ``` * const lambda = new nodejs.NodejsFunction(this, 'KafkaConsumerFunction', { * entry: 'path.to.handler.ts', * handler: 'handlerName', * }); * * const secret = Secret.fromSecretNameV2(this, 'ConsumerSecret', 'kafka-integration/msk-certificate/') * * lambda.addEventSource(new RioKafkaEventSource({ * secret, * topic: '', * startingPosition: StartingPosition.TRIM_HORIZON, * })); * ``` */ export declare class RioKafkaEventSource implements lambda.IEventSource { private props; constructor(props: RioKafkaEventSourceProps); bind(target: lambda.IFunction): void; }