Search code examples
amazon-web-servicesamazon-dynamodbaws-cdkamazon-kinesis

Creating a Kinesis Stream on existing DynamoDB table


I already have an existing DynamoDB table when regularly gets updated with data from an upstream source. How can I create a new Kinesis stream to consume updates from the table in AWS CDK?

From other posts, I see that the ddb table must be enabled with streaming at the time of creation. Is there a workaround for this in CDK?


Solution

  • You can simply enable KDS on DynamoDB by passing the newly created stream as IStream into the kinesisStream parameter of your tables construct.

    https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_dynamodb.Table.html#kinesisstream