import * as cdk from '@aws-cdk/core'; import { KafkaEventSpecSource } from './kafka-event-spec'; /** * Wrapper for all meta data of a topic. * * @stability stable */ export interface KafkaTopicMetaData { /** * The event specs of the events on that topic. * * @stability stable */ readonly events: KafkaEventSpecSource[]; /** * Describes the intent of the topic. * * This might be information about the events on that topic * or additional information about the producer and the context of the events. * * @stability stable */ readonly description: string; } /** * Read and write permissions for the topic. * * strings are matched against the CNAME of the certificate of the Kafka clients. * * @stability stable */ export interface KafkaAclStatement { /** * List of clients that should get write permissions. * * @stability stable */ readonly write: string[]; /** * List of clients that should get read permissions. * * @stability stable */ readonly read: string[]; } /** * Wrapper for all log compaction related properties. * * @stability stable */ export interface LogCompactionProperties { /** * The amount of time to retain delete tombstone markers for log compacted topics; * * The soft limit is 10 days but can be increased upon requests. * * @default 1 day * @stability stable */ readonly deleteRetention?: cdk.Duration; } /** * The current service limits can be found in the topic limits configuration of the topic manager. * * @see https://collaboration.msi.audi.com/stash/projects/RSEVTBU/repos/topic-manager/browse/config/topic-service-limits.yaml * @stability stable */ export interface KafkaTopicProps { /** * The unique name of the topic; * * has to match pattern [A-Za-z0-9.-]+ * * @stability stable */ readonly name: string; /** * Defines degree of parallelism of the topic; * * should be increased for * large expected loads (e.g., 25 for rio.asset-iot-events). * The soft limit is 10 partitions but can be increased upon requests. * * @stability stable */ readonly numberOfPartitions: number; /** * Defines degree of replication of messages; * * has to be between 1 and the number of brokers (currently 3). * * @default 3 * @stability stable */ readonly replicationFactor?: number; /** * Time how long messages are retained on Kafka cluster; * * We recommend 30 days for general events and 7 days for sensor events and other high-load cases. * The soft limit is 3 to 30 days but can be increased upon requests. * * @default 7 days * @stability stable */ readonly retention?: cdk.Duration; /** * If set to 'false, the topic's data will be deleted on Kafka 10 days after stack deletion. * * If set to 'true', it will be deleted immediately after stack deletion. * * @default false * @stability stable */ readonly instantDeletionEnabled?: boolean; /** * The metadata of the topic. * * @stability stable */ readonly metadata: KafkaTopicMetaData; /** * The permissions to access to the topic's data. * * @stability stable */ readonly acl: KafkaAclStatement; /** * Specify whether the topic is log compacted or not. * * @stability stable */ readonly isLogCompacted: boolean; /** * Must only be provided if 'isLogCompacted' is 'true'. * * @default undefined * @stability stable */ readonly logCompactionProperties?: LogCompactionProperties; } /** * Construct to create a kafka topic. * * @stability stable */ export declare class KafkaTopic extends cdk.Construct { /** * @stability stable */ constructor(scope: cdk.Construct, id: string, props: KafkaTopicProps); }